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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Dax error

I need your help with that calculation , firstly I used dax to divid CY by LY to yield (Value Divide) , as shown below

1.jpg

then used another dax to minus value divide from 1 (value divide - 1) as shown below

3.jpg

but the rewult was not good , it minus all rows not only the filtered one and yield many rows with -100%
2.jpg
I think there is a mistake in my dax (value divide -1) what should I edit?

 

2 REPLIES 2
daxer-almighty
Solution Sage
Solution Sage

 

[Brand PPG] =
var __division = [Value Divide]
return
    IF( __division, __division - 1 )

 

The above formula says: If __division is BLANK or 0, do not display (__division - 1). This works because 0 and BLANK() are treated as False when used in a bool context.

 

If you want to get max speed from the calculation, you'd do this:

 

[Brand PPG] =
var __division = [Value Divide]
var __shouldCalc = DIVIDE( __division, __division )
return
    __shouldCalc * (__division - 1)

 

The above does not use IF and hence has the potential to only use Storage Engine, hence maximum speed.

AntrikshSharma
Super User
Super User

@Anonymous  Use this 

=
IF ( [Value CY] <> BLANK () && [Value LY] <> BLANK (), [Values Divide] )

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.