cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tuffy Regular Visitor
Regular Visitor

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

Accepted Solutions
Highlighted
Super User
Super User

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

@Tuffy 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]) 

 

image.pngOutputimage.pngSample Data

 



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

Proud to be a Datanaut !





2 REPLIES 2
Highlighted
Super User
Super User

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

@Tuffy 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]) 

 

image.pngOutputimage.pngSample Data

 



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

Proud to be a Datanaut !





Tuffy Regular Visitor
Regular Visitor

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

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