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
samnaw
Resolver I
Resolver I

Variance Calculation Question

Not sure if there is a solution to this or not:

 

This is how my DAX formula is for varience:

measures = [Light Blue DAX formula] - [Dark Blue DAX formula] 

 

The reason why the orange line drops of because there is no data for WK40 (Light Blue Line). So it calculates as only Dark Blue Line. Variance = -28%. 

 

For a number of reason I dont want to adjust my Dark Blue line DAX formual. Is there any way I can adjust my Varience DAX formula so if light Blue line = 0% it stops calculating. Not sure if there is a solution to this or not. 

 

samnaw_0-1666891448956.png

 

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @samnaw ,

Did the pbi-novice's answer helped you? If so, please consider marking the most helpful answer as a solution, as this will help people searching the forum for similar questions in the future to find answers more quickly. Thanks in advance!

 

Or please try:

Measures =
IF (
    [Ligth Blue DAX Formula] = BLANK (),
    BLANK (),
    [Ligth Blue DAX Formula] - [Dark Blue DAX Formula]
)

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

pbi-novice
Helper I
Helper I

Have you tried using IF?

 

IF([Ligth Blue DAX Formula] = 0%, BLANK(), [Ligth Blue DAX Formula]-[Dark Blue DAX Formula])

 

This might change depending on whether the value for Light Blue line is BLANK or 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.