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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mglatos
New Member

% of specific status measure

Hi All,

 

Hope someone can help me with that. I'm trying to create measure which calculate % of total amount of ID's based on status (outstanding or completed). Unfortunately the way my data source is created I cannot figure out a way to do that. 

Base on below data how to create % of Outstanding  to show as 75% ?

 

ID   Status

2     Outstanding

3     Close

4     Outstanding

6     Outstanding

 

I hope it make sense?

 

Thanks a lot!

5 REPLIES 5
Phil_Seamark
Employee
Employee

This should work as a measure

 

Measure = DIVIDE(
				 CALCULATE(COUNTROWS('Table1')) , 
				 CALCULATE(COUNTROWS(all(Table1)) 
					 )

Can probably do it as a calculated column if need too..


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Thank you so much for replying! I've just tried that and unfortunately it's doesn't work for me.

In the 'table1' you selecting whole table, correct?

Mine Measure looks like that - but I've might have made a mistake. Would you mind have a look?

 

Measure = DIVIDE(
                 CALCULATE(COUNTROWS('ALL_DATA_x')) ,
                 CALCULATE(COUNTROWS(all(ALL_DATA_x[Status] ))
                     ))

Does this looks correct?

 

Thanks a lot

Sean
Community Champion
Community Champion

Try these instead

Measure 1 =
DIVIDE (
    COUNTROWS ( 'ALL_DATA_x' ),
    CALCULATE ( COUNTROWS ( 'ALL_DATA_x' ), ALL ( 'ALL_DATA_x' ) ),
    0
)

Measure 2 =
DIVIDE (
    COUNTA ( 'ALL_DATA_x'[Status] ),
    CALCULATE ( COUNTA ( 'ALL_DATA_x'[Status] ), ALL ( 'ALL_DATA_x' ) ),
    0
)

 

 EDIT: You may change ALL to ALLSELECTED if necessary Smiley Happy

Thank you so much for replying! I've just tried that and unfortunately it's doesn't work for me.

In the 'table1' you selecting whole table, correct?

Mine Measure looks like that - but I've might have made a mistake. Would you mind have a look?

 

Measure = DIVIDE(
                 CALCULATE(COUNTROWS('ALL_DATA_x')) ,
                 CALCULATE(COUNTROWS(all(ALL_DATA_x[Status] ))
                     ))

Does this looks correct?

 

Thanks a lot

Hi @mglatos,

You should add a filter in your measure. I try to reproduce using your given sample data.

1.PNG

 If you want to calculate  % of Outstanding, please add ALL_DATA_x[Status]="Outstanding" filter, please review the following formula.

Measure = DIVIDE(CALCULATE(COUNTROWS(Table5),FILTER(Table5,Table5[Status]="Outstanding")),CALCULATE(COUNTROWS(Table5),ALL(Table5)))



Format the measure as %(highlighted in red line), and create a Card visual to dislay the result.

1.PNG

If you have other issues, please let me know.

Best Regards,
Angelia

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.