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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
Responsive Resident
Responsive Resident

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.