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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.