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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
mfminor
Helper I
Helper I

Percentage Calculation

Trying to create a percentage based on two different  fields depending on which model, how many returns processed / total units produced. I made some attempts that did not work but the very basic idea of what I need would be Formula count / total produced. The measure for Formula Count is shown in the picture. I also know that some Total Produced values are blank. I am pretty new to Power BI so hopefully this isn't something too obvious. The reason it has not worked for me so far is that there are multiple values where PowerBI expects one value to be present (the Total Produced column).

 

 

ced.percentquestion.png

2 REPLIES 2
Anonymous
Not applicable

I think this can help.

 

Always use "/Calculate AllSelected" to get percentages, for me is the best way.

and the "if isblank" fixes the problem with lines without values.

 

 

Percentage = if( Isblank(
Counta(AviationTable[Unit Description])) ;0 ;Counta(AviationTable[Unit Description]) /CALCULATE(Counta(AviationTable[Unit Description]);AllSelected())

I Hope to have helped

macdo
Frequent Visitor

Im not an expert at all, but did you try:

Percentage = [Formula Count] / [Total Produced]

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors