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

how to write IF OR IF in DAX

hi,

I have a problem to make a Dax like this

1. If the Practice manager is selected, the card will display max data
2. If the practice manager is selected and the month is selected then displays the value of the month

for the logic that I make on DAX like this

 

Logic 1
IF (ISFILTERED (PM [PM]); MAX (TURNOVER [TURNOVER]); "")

Logic 2
IF (ISFILTERED (PM [PM]) && ISFILTERED (MONTH [MONTH]); MAX (TURNOVER [TURNOVER]; "")

 
 

and i want to combine both logic to 1 dax use OR
can it be made?

123.png

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

In order to combine two IF formula, you can just add the other IF in the false statement. Try:

 

test = IF(ISFILTERED(L2[L2]),MAX('TurnOver Rate / PM'[TurnOver - Copy]),
       IF(ISFILTERED(L2[L2])&&ISFILTERED('Urutan Bulan'[Month]),MAX('TurnOver Rate / PM'[TurnOver    - Copy]),BLANK()))

 

If the result returns true there should be some issue with your the IF formula, in this case we would need some sample data.


Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quicly.

View solution in original post

4 REPLIES 4
V-pazhen-msft
Community Support
Community Support

@Anonymous 

In order to combine two IF formula, you can just add the other IF in the false statement. Try:

 

test = IF(ISFILTERED(L2[L2]),MAX('TurnOver Rate / PM'[TurnOver - Copy]),
       IF(ISFILTERED(L2[L2])&&ISFILTERED('Urutan Bulan'[Month]),MAX('TurnOver Rate / PM'[TurnOver    - Copy]),BLANK()))

 

If the result returns true there should be some issue with your the IF formula, in this case we would need some sample data.


Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quicly.

Anonymous
Not applicable

@V-pazhen-msft 

thank you so much !
it's work!

 

i click june and PM, the card show turnover value of that month!

1234.png

 

BR,
Faishal

amitchandak
Super User
Super User

Try like

 

IF (ISFILTERED (PM [PM]) && ISFILTERED (MONTH [MONTH]); MAX (TURNOVER [TURNOVER]); IF (ISFILTERED (PM [PM]); MAX (TURNOVER [TURNOVER]); ""))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Anonymous
Not applicable

hi @amitchandak 

ah i already try with your code
but the result is TRUE or FALSE

 
test = IF(ISFILTERED(L2[L2])&&ISFILTERED('Urutan Bulan'[Month]);MAX('TurnOver Rate / PM'[TurnOver - Copy]);IF(ISFILTERED(L2[L2]);MAX('TurnOver Rate / PM'[TurnOver - Copy]);""))
lala.png

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.