Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Vish_korg
Frequent Visitor

Customize table formation

I am completey new to Power Bi .I require help to make a new table for the following data.

Existing table

Losses

Down Time

Break down

30

Start up loss

20

Clita

10

Break down

10

Set up loss

15

clita

5

Cleaning

10

Set up loss

10

 

Require the following output             

Required out put

  

Losses

Down Time sum

Down time average

% of total time

Break down

40

20

36%

Start up loss

20

20

18%

Clita

15

7.5

14%

Cleaning

10

10

9%

Set up loss

25

12.5

23%

 

110

14

100%

Can any one help?

 

2 ACCEPTED SOLUTIONS
BA_Pete
Super User
Super User

Hi @Vish_korg ,

 

You would do this using measures in your model and a basic table visual.

Your measures would be calculated as follows, where 'YourTable' should be replaced with the actual name of your table in the model:

Down Time Sum = SUM(YourTable[Down Time])
Down Time Avg = AVERAGE(YourTable[Down Time])
% Total Down Time = 
VAR __TotalTime =
CALCULATE(
    SUM(YourTable[Down Time]),
    ALLSELECTED(YourTable[Losses])
)
RETURN
DIVIDE([Down Time Sum], __TotalTime, 0)

 

Using these measures in a table visual with the [Losses] column from YourTable gives the following output:

 

BA_Pete_0-1729490579911.png

 

 

Pete

 



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

shafiz_p
Super User
Super User

Hi @Vish_korg , Try belwo M code in power query advance option:

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Losses", type text}, {"Down Time", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Losses"}, {{"Down Time", each List.Sum([Down Time]), type nullable number}, {"Down Time Avg", each List.Average([Down Time]), type nullable number}}),
    TotalSum = List.Sum(#"Grouped Rows"[Down Time]),
    AddPercentTotal = Table.AddColumn(#"Grouped Rows", "% of Total Time", each [Down Time]/TotalSum),
    #"Changed Type1" = Table.TransformColumnTypes(AddPercentTotal,{{"% of Total Time", Percentage.Type}})
in
    #"Changed Type1"

 

See images below for different steps:

shafiz_p_0-1729491762017.pngshafiz_p_1-1729491841923.pngshafiz_p_2-1729491893877.pngshafiz_p_3-1729491925749.png

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution!!

 

 

Best Regards,
Shahariar Hafiz

View solution in original post

4 REPLIES 4
shafiz_p
Super User
Super User

Hi @Vish_korg , Try belwo M code in power query advance option:

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Losses", type text}, {"Down Time", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Losses"}, {{"Down Time", each List.Sum([Down Time]), type nullable number}, {"Down Time Avg", each List.Average([Down Time]), type nullable number}}),
    TotalSum = List.Sum(#"Grouped Rows"[Down Time]),
    AddPercentTotal = Table.AddColumn(#"Grouped Rows", "% of Total Time", each [Down Time]/TotalSum),
    #"Changed Type1" = Table.TransformColumnTypes(AddPercentTotal,{{"% of Total Time", Percentage.Type}})
in
    #"Changed Type1"

 

See images below for different steps:

shafiz_p_0-1729491762017.pngshafiz_p_1-1729491841923.pngshafiz_p_2-1729491893877.pngshafiz_p_3-1729491925749.png

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution!!

 

 

Best Regards,
Shahariar Hafiz

Note that the source table had case differences (Clita and clita), so the grouping needs to be case insensitive:

 

 

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    GroupedRows = Table.Group(Source, {"Losses"}, {{"DT Sum", each List.Sum([Down Time]), type number}, {"DT average", each List.Average([Down Time]), type number},{"% Total Time",each List.Sum([Down Time])/List.Sum(Source[Down Time]),Percentage.Type}},null,Comparer.OrdinalIgnoreCase)
in
    GroupedRows

 

 

 

p45cal_0-1729507733886.png

Note also a difference in the average 'total' at the bottom, the OP has 14 whereas @BA_Pete's has 13.8 (real value 13.75) because the one is the average of the grouped averages, the other the average of the original ungrouped values.

BA_Pete
Super User
Super User

Hi @Vish_korg ,

 

You would do this using measures in your model and a basic table visual.

Your measures would be calculated as follows, where 'YourTable' should be replaced with the actual name of your table in the model:

Down Time Sum = SUM(YourTable[Down Time])
Down Time Avg = AVERAGE(YourTable[Down Time])
% Total Down Time = 
VAR __TotalTime =
CALCULATE(
    SUM(YourTable[Down Time]),
    ALLSELECTED(YourTable[Losses])
)
RETURN
DIVIDE([Down Time Sum], __TotalTime, 0)

 

Using these measures in a table visual with the [Losses] column from YourTable gives the following output:

 

BA_Pete_0-1729490579911.png

 

 

Pete

 



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Works perfectly.

 

Thanks

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors