Power BI Visulization Query

shansakhi

Active Member
Joined
Apr 5, 2008
Messages
296
Office Version
  1. 365
Platform
  1. Windows
Hi All,
I am trying to build a report in Power BI, here I need your support to guide me how I can achieve the required visulization.

Here W1 is our comany.


Book1
BCDEFGHIJKLMNOP
3
4Input Output
5Bus RouteFare ($)Bus CompanyBus RouteW1 (Our Company) FareMin (Lowest) Fare% Lower than W1Other Bus Company >>>>>> Lower to Higher fares excluding W1
6BOM-DEL20W1 (Our Company)BOM-DEL2014-30%F10 / 14C5 / 25A10 / 30
7BOM-DEL25C5BOM-BLR2220-9%H19 / 20K1 / 25E10 / 33Y12 / 38J25 / 48
8BOM-DEL14F10
9BOM-DEL30A10
10BOM-BLR28W1 (Our Company)
11BOM-BLR33E10
12BOM-BLR20H19
13BOM-BLR38Y12
14BOM-BLR48J25
15BOM-BLR25K1
16
Sheet1
Cell Formulas
RangeFormula
J6:J7J6=I6/H6-1



Regards,
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
a proposal close to your request

Power Query:
let
A = Excel.CurrentWorkbook(){[Name="Inpout"]}[Content],
    B = {"Bus Route", "W1 (Our Company) Fare", "Min (Lowest) Fare", "% Lower than W1", "Other Bus Company >>>>>>" & "#(lf)" & "Lower to Higher fares excluding W1"},
C = Table.Combine(Table.Group(A, {"Bus Route"}, {"x", each 
[ 
 a = List.Zip(List.Skip(Table.ToColumns(_))),
 b = List.Select(a, each _{1} = "W1 (Our Company)"),
 c = List.Sort(a, each _{0}),
 d = let x = {b{0}{0}, c{0}{0}} in {Table.FirstValue(_)} & x & {x{1}/x{0} -1} & List.Transform({List.Transform(List.RemoveItems(c,b), each Text.From( _{1}) & " / $" & Text.From (_{0}))}, each Text.Combine(_," < ")),
 e = Table.FromRows({d},B)
] [e]})[x]) 
in C

Regards,
 
Upvote 0
Thank you.
But unfortunalty I am not sure how do I use this in POwer BI.
Can you please guide me.

Thank you.
 
Upvote 0
You can use that Mcode in the power query editor behind PowerBI
 
Upvote 0
I have uploaded the data in Power BI and then as a new query I have copied the above code... but I am getting below ..

1736927080299.png
 
Upvote 0
you have to paste that code in the advanced editor
 
Upvote 0
I think, I am doing somthing wrong.
I am trying to add A= file location and sheet name, but getting error.
Because with the earlier provided code, I am not getting the excel file.


VBA Code:
let
[B]A = Excel.Workbook("D:\BusRoute_PB_workring.xlsx"){[Name="Sheet3"]}[Content],[/B]

    B = {"Bus Route", "W1 (Our Company) Fare", "Min (Lowest) Fare", "% Lower than W1", "Other Bus Company >>>>>>" & "#(lf)" & "Lower to Higher fares excluding W1"},
C = Table.Combine(Table.Group(A, {"Bus Route"}, {"x", each
[
 a = List.Zip(List.Skip(Table.ToColumns(_))),
 b = List.Select(a, each _{1} = "W1 (Our Company)"),
 c = List.Sort(a, each _{0}),
 d = let x = {b{0}{0}, c{0}{0}} in {Table.FirstValue(_)} & x & {x{1}/x{0} -1} & List.Transform({List.Transform(List.RemoveItems(c,b), each Text.From( _{1}) & " / $" & Text.From (_{0}))}, each Text.Combine(_," < ")),
 e = Table.FromRows({d},B)
] [e]})[x])
in C
 
Upvote 0

Forum statistics

Threads
1,225,491
Messages
6,185,298
Members
453,286
Latest member
JCM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top