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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to show the % value by sub-grouping and NOT by grand total

Hi all,

 

I am wondering if there is way to show the percentage breakdown based on sub-grouping instead of by grand total.

For example,

I want to create a new column to show the % breakdown based on Owner column grouping intead of the grand total (201).

hence, the machine_status2 breakdown based on Owner grouping of "Social NYKT" are 5%, 35%, and 60% respectively total count of machine status under owner is 110 (5+39+66).

I am trying to use New Quick Measure, but i was lost.  Thanks

 

 

F1.png

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@Anonymous Please try to post your sample data always in copiable format.

 

Here is the solution that you are looking for.. Create a new measure as below

 

Test204Percent = 
VAR _SubTotal = CALCULATE(COUNTROWS(Test204SubTotalPercent),ALLEXCEPT(Test204SubTotalPercent,Test204SubTotalPercent[Owner]))
RETURN FORMAT([Test204Cnt]/_SubTotal,"Percent")

Assuming that you already have another measure to show the counts that you have mentioned in your screenshot. In above calculation, that measure will be [Test204Cnt] with the logic 

 

Test204Cnt = COUNT(Test204SubTotalPercent[MachineStatus]) 

 

OutputOutputSample DataSample Data

 





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
PattemManohar
Community Champion
Community Champion

@Anonymous Please try to post your sample data always in copiable format.

 

Here is the solution that you are looking for.. Create a new measure as below

 

Test204Percent = 
VAR _SubTotal = CALCULATE(COUNTROWS(Test204SubTotalPercent),ALLEXCEPT(Test204SubTotalPercent,Test204SubTotalPercent[Owner]))
RETURN FORMAT([Test204Cnt]/_SubTotal,"Percent")

Assuming that you already have another measure to show the counts that you have mentioned in your screenshot. In above calculation, that measure will be [Test204Cnt] with the logic 

 

Test204Cnt = COUNT(Test204SubTotalPercent[MachineStatus]) 

 

OutputOutputSample DataSample Data

 





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

Proud to be a PBI Community Champion




Anonymous
Not applicable

Hi Manohar,

 

It doesn't work as I use the same formula like yours in my measure..

 

SumOfTotalCountOfMachineStatusByOwner = COUNT('Machines-20190219'[Machine_status2])/

                  Calculate(Count('Machines-20190219'[Machine_status2]), All('Machines-20190219'))

 

Your formula:

SumOfTotalCountOfMachineStatusByOwner = COUNT('Machines-20190219'[Machine_status2])/
                  Calculate(Countrows('Machines-20190219'), ALLEXCEPT('Machines-20190219', 'Machines-20190219'[Owner]))

 

and the result is 1 and not reflecting the correct value

I try to send you the dataset sample and but this forum does not have the icon for this purpose.

Can you provide me your email and drop you a box for this? Thanks.

F2.PNG

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.