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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
yeshk
New Member

Calculating Fraction in power bi

I have a table with multiple columns which comes from different data sources. in which 2 columns are Actual Number and Expected Number(both are measures). I have to create a new column in the table which just shows Actual Number/Expected Number.

Few rows have blanks for both Actual and Expected, for which i have to show "N/A". I was able to acheive the first part where we just show actual/expected, But challenge is when changing the logic to show N/A for blank values of actual and expected columns.

what i tried:

Created a measure,This works perfectly for non-blanks

IF([Actual] >0,[Actual]&"/"&[Expected])

I changed the measure to this to show N/A for blanks:

IF(ISBLANK([Actual]) ||ISBLANK([Expected]),"N/A",IF([Actual] >0,[Actual]&"/"&[Expected]))

when i try the above, the no of rows in the table drastically increases creating duplicates and i get many records with "N/A", where i only have 1 row which has blank actual/expected. Im unsure what is causing the issue and want to know what is the best way to approach this. Thanks in advance

2 REPLIES 2
ShivangDalal
New Member

Are you making a calculated column or a measure? Making a calculated column might help.

im creating a measure, so youre saying i should create a column? beacuse both actual and expected are measures already

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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