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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

View discussion in a popup

Replying to:

FBergamaschi 

Thanks for your reply but I can not write condition for more than 200 unique Projects.

VAR Selection = VALUES ( Dim[Project] )
VAR SelectionExpandedA = UNION( Selection, {"Include A"} )
VAR SelectionExpandedB = UNION( Selection, {"Include B"} )
VAR SelectionExpandedAB = UNION( Selection, {"Include A"},{"Include B"}  )
VAR Result=
IF (
    ("P1" IN Selection || "P2" IN Selection) && ("P3" IN Selection || "P4" IN Selection),
    CALCULATE( MAX ( Facts[Risk Value] ), KEEPFILTERS(Facts[Project] IN SelectionExpandedAB )),
    IF (
          "P1" IN Selection || "P2" IN Selection,
CALCULATE( MAX ( Facts[Risk Value] ), KEEPFILTERS(Facts[Project] IN SelectionExpandedA ) ),
IF (
          "P3" IN Selection || "P4" IN Selection,
          CALCULATE( MAX ( Facts[Risk Value] ), KEEPFILTERS(Facts[Project] IN SelectionExpandedB ))
)
    ))
    RETURN Result
 
 
Could you please do needfull ? Thanks