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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
rickylee
Helper III
Helper III

% total in a pie chart, can be done per row only?

Hello,

I have the following table in database.

 

ApplicationStage1Stage2Stage3
A01/09/201802/09/201803/09/2018
B01/09/201803/09/201807/09/2018


I added two columns to find out the hours it take to pass each stage:

 

Capture.PNG

The formula of the new added columns:
Stage1 -> Stage2 = DATEDIFF(Sheet1[Stage1],Sheet1[Stage2],HOUR)

Stage2 -> Stage3 = DATEDIFF(Sheet1[Stage2],Sheet1[Stage3],HOUR)

Then, I display the information in a table and a pie chart like this:
Capture2.PNG

Then, I select row 1, application A, to see the % of the pie chart:

Capture3.PNG

 

My problem arised in here: I expected the chart to be 50% (Stage1 -> Stage2) and 50% (Stage2->Stage3) because each stage takes 24 hours. The maths should be 24 /(24+24) = 50%

However, I think power bi adds up the total of both stages I.e. So "Stage1 -> Stage2" is 24/(72+120) = 12.5%.

This is not what I need. Is there a solution for this?

Thanks,
Ricky 

 

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@rickylee I've tried below steps to solve your scenario..

 

Please do the additional calculation columns in "Power Query Editor" using custom column as below

 

Duration.TotalHours([Stage2]-[Stage1])
Duration.TotalHours([Stage3]-[Stage2])

Now the table looks like this...

 

image.png

 

Now, unpivot all the fields apart from the "Application" field and it will look like this

 

image.png

 

Now use the "Matrix" visual and Pie-Chart and the output looks like this...

 

But in the pie-chart, you need to have visual level filters to have only "Stage1toStage2" and "Stage2toStage3" attributes only.

 

image.png

 

Hope this helps !!





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi Ricky,

 

You also can use a slicer. Please refer to the snapshot below.

total_in_a_pie_chart_can_be_done_per_row_only

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PattemManohar
Community Champion
Community Champion

@rickylee I've tried below steps to solve your scenario..

 

Please do the additional calculation columns in "Power Query Editor" using custom column as below

 

Duration.TotalHours([Stage2]-[Stage1])
Duration.TotalHours([Stage3]-[Stage2])

Now the table looks like this...

 

image.png

 

Now, unpivot all the fields apart from the "Application" field and it will look like this

 

image.png

 

Now use the "Matrix" visual and Pie-Chart and the output looks like this...

 

But in the pie-chart, you need to have visual level filters to have only "Stage1toStage2" and "Stage2toStage3" attributes only.

 

image.png

 

Hope this helps !!





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.