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

DAX Question - only peform operation where there is data available?

Hello Power BI Pals!

 

I have a DAX question - all I want to do is to subtract 1 from each of these USG% figures,  so I can have a table like this:

Jan-20 0.39
Feb-20 0.42
Mar-20 0.52

etc
However, as you can see below, if I try to just subtract one, I get a minus 1 for all the other days in the month that don't have any data.

DAX Q.PNG

Can I force it to ignore all the other days in the month, and just do on the day which has data (which is always the first of the month, e.g. 01/01/2020

Thank so much!

 

Alex

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous 

 

USG% =
VAR res_ =
    DIVIDE ( A, B ) //This will return blank when there is no data
RETURN
    IF ( NOT ISBLANK ( res_ ), res_ - 1 )

 

A and B are the numerator and denominator that you have...

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

Hi @Anonymous 

 

USG% =
VAR res_ =
    DIVIDE ( A, B ) //This will return blank when there is no data
RETURN
    IF ( NOT ISBLANK ( res_ ), res_ - 1 )

 

A and B are the numerator and denominator that you have...

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Anonymous
Not applicable

That works great - thanks! 🙂

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.