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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Maithilitiwari
Frequent Visitor

IF Statement

Recurring Bookings = IF( ISFILTERED(Renewal[RENEW FLAG]) &&

SELECTEDVALUE(Renewal[RENEW FLAG]) = "NEW BUSINESS" &&

SELECTEDVALUE(BusinessMix[Bookings by Class]) IN {"License Support", "Hardware Support", "Subscription", "SAAS", "BCS", "Consumption"},

"True",

"False" )

This measure should return True when the following conditions are met: Renewal[RENEW FLAG] is filtered. The selected value of Renewal[RENEW FLAG] is "NEW BUSINESS". The selected value of BusinessMix[Bookings by Class] is all of the specified classes only if anything else is selected or no value is selected then it should return false

1 ACCEPTED SOLUTION

Recurring Bookings =
IF(
    ISFILTERED(Renewal[RENEW FLAG]) &&
    SELECTEDVALUE(Renewal[RENEW FLAG]) = "NEW BUSINESS" &&
    COUNTROWS(
        FILTER(
            ALLSELECTED(BusinessMix[BookinLicense Support", "Hardware Support", "Subscription", "SAAS", "BCS", "Consumption"}gs by Class]),
            BusinessMix[Bookings by Class] IN {"
        )
    ) = 6 &&
    COUNTROWS(ALLSELECTED(BusinessMix[Bookings by Class])) = 6,
    "True",
    "False"
)
 
 
This code is working
So if i select all of these
("License Support", "Hardware Support", "Subscription", "SAAS", "BCS", "Consumption") i get true and if anything is missing or nothing is selected it gives me false

View solution in original post

6 REPLIES 6
manvishah17
Solution Supplier
Solution Supplier

Hi @Maithilitiwari , 
your DAX seems perfect , could you plz ellaborate your issue??

I am getting true only when License Support is selected apart from that i am getting false there is a logical error

 

If you are getting "True" only when "License Support" is selected and "False" otherwise,  the issue might be with how the values are being compared or how the SELECTEDVALUE function is operating within the filter context.
Could you please share sample dataset..
or else try this dax 

 

Recurring Bookings = 
VAR SelectedRenewFlag = SELECTEDVALUE(Renewal[RENEW FLAG])
VAR SelectedBookingClass = SELECTEDVALUE(BusinessMix[Bookings by Class])
VAR ValidClasses = {"License Support", "Hardware Support", "Subscription", "SAAS", "BCS", "Consumption"}

RETURN
IF(
    ISFILTERED(Renewal[RENEW FLAG]) &&
    SelectedRenewFlag = "NEW BUSINESS" &&
    NOT ISBLANK(SelectedBookingClass) &&
    SelectedBookingClass IN ValidClasses,
    "True",
    "False"
)

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Recurring Bookings =
IF(
    ISFILTERED(Renewal[RENEW FLAG]) &&
    SELECTEDVALUE(Renewal[RENEW FLAG]) = "NEW BUSINESS" &&
    COUNTROWS(
        FILTER(
            ALLSELECTED(BusinessMix[BookinLicense Support", "Hardware Support", "Subscription", "SAAS", "BCS", "Consumption"}gs by Class]),
            BusinessMix[Bookings by Class] IN {"
        )
    ) = 6 &&
    COUNTROWS(ALLSELECTED(BusinessMix[Bookings by Class])) = 6,
    "True",
    "False"
)
 
 
This code is working
So if i select all of these
("License Support", "Hardware Support", "Subscription", "SAAS", "BCS", "Consumption") i get true and if anything is missing or nothing is selected it gives me false
_AAndrade
Super User
Super User

Where is your issue?





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




I am getting true only when License Support is selected apart from that i am getting false

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.