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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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