Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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?

  • Anonymous's avatar
    Anonymous
    6 years ago

    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.

4 Replies

  • 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's avatar
      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]);""))
  • Anonymous's avatar
    Anonymous
    Not applicable

    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's avatar
      Anonymous
      Not applicable

      Anonymous 

      thank you so much !
      it's work!

       

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

       

      BR,
      Faishal