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
Anonymous
Not applicable

Help with formula returning information instead of null

How can I rewrite the highlighted formula so that it will be blank instead of 100% for the months in the future on the "Average Margin" tile?  I want it to be blank like all the rest of the tiles to the right of it.

 

Capture.PNG

1 ACCEPTED SOLUTION

Margin% =
DIVIDE (
    SUM ( AvgPricePer[Invoice Charge] ) - SUM ( AvgPricePer[Cost] ),
    SUM ( AvgPricePer[Invoice Charge] ),
    0
)

View solution in original post

2 REPLIES 2
Phil_Seamark
Employee
Employee

Hi @Anonymous

 

You could try it using IF.  So somthing along the lines of this

 

Margin% = IF(
			(1-(sum(AvgPricePer[Cost]) / sum(AvgPricePer[Invoice Charge]))) = 1 ,
			BLANK(),
			1-(sum(AvgPricePer[Cost]) / sum(AvgPricePer[Invoice Charge]))
			)

Also you might want to have a look into the DIVIDE function

 

So rather that write x = y / z

you can write x = DIVIDE(y,z)  to get better results


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

Proud to be a Datanaut!

Margin% =
DIVIDE (
    SUM ( AvgPricePer[Invoice Charge] ) - SUM ( AvgPricePer[Cost] ),
    SUM ( AvgPricePer[Invoice Charge] ),
    0
)

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.