Forum Discussion
Maithilitiwari
2 years agoFrequent 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 S...
- 2 years agoRecurring 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 workingSo 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
manvishah17
2 years agoSolution Supplier
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!
Maithilitiwari
2 years agoFrequent Visitor
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