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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
perviiri
New Member

need help with DAX

Hi, I need help with DAX. 
I'm connected to LIVE datasource. Where I have three Variable dimension (Var. dim 1, Var. dim 2, Var. dim 3) which were created by Parameters fields.

perviiri_0-1701855250874.png

I have matrix visualization with 3 levels Var. dim 1, Var. dim 2, Var. dim 3 and value - TEST (calculated measure), and three slicers Var. dim 1, Var. dim 2, Var. dim 3.

I need to create a measure which will give result when selected Var. dim 1 = 'FP-MKD' then result TEST for 1st level should be blank, otherwise TEST value, if selected Var. dim 2 'FP-MKD' (but different Var. dim 1 and Var. dim 3), then for 1st level "Var. dim 1" result = TEST value but if person Expand second level he will still see result for the first level, but for the second level "Var. dim 1"result will be blank. The same for the third level. If Var. dim 1 <>'FP-MKD' , Var. dim 2 <>'FP-MKD' but Var. dim 3 = 'FP-MKD' Then TEST will be shown for the first level, second level, but third level will be blank.
I've tried different ways, but it didn't give correct resuld. It eather blank everything or shows everything. Example

perviiri_1-1701855856012.png

that's fine. But when I expand for the second level, it should be blank, but still shows me some numbers: 

perviiri_3-1701856636031.png

I want something like this

1st level (Var. dim 1 ='FP-MKD', Var. dim 2 <>'FP-MKD', Var. dim 3 <>'FP-MKD')

perviiri_4-1701856712145.png

2nd level (Var. dim 1 <>'FP-MKD', Var. dim 2 ='FP-MKD', Var. dim 3 <>'FP-MKD' )

perviiri_2-1701856619201.png

3rd level  (Var. dim 1 <>'FP-MKD', Var. dim 2 <> FP-MKD', Var. dim 3 = 'FP-MKD' )

perviiri_5-1701856884338.png

I've tried different ways, but it doesn't work. For SELECTEDVALUE I had to use Parameter field column "'Var. Dims 1'[Var. Dims 1 Felder]" because it hadn't allowe me to use "'Var. Dims 1'[Var. Dims 1]" column which Iuse in visulaizations.

 

4 examples of my measures 😂

TEST =
VAR selected_dim1 = SELECTEDVALUE('Var. Dims 1'[Var. Dims 1 Felder])
VAR selected_dim2 = SELECTEDVALUE('Var. Dims 2'[Var. Dims 2 Felder])
VAR selected_dim3 = SELECTEDVALUE('Var. Dims 3'[Var. Dims 3 Felder])

VAR _result = IF(selected_dim3 = "'Full Price Flag'[Full Price Flag Description]","",
                IF(selected_dim2 = "'Full Price Flag'[Full Price Flag Description]","",
                  IF(selected_dim1 = "'Full Price Flag'[Full Price Flag Description]"
, "",[EOH])))

VAR dim1 = IF(selected_dim1 = "'Full Price Flag'[Full Price Flag Description]","",[EOH])
VAR dim2 = IF(selected_dim2 = "'Full Price Flag'[Full Price Flag Description]","",[EOH])
VAR dim3 = IF(selected_dim3 = "'Full Price Flag'[Full Price Flag Description]", "",[EOH])

VAR _result1 = SWITCH(TRUE(),
                ISINSCOPE('Var. Dims 3'[Var. Dims 3]),dim3,
                ISINSCOPE('Var. Dims 2'[Var. Dims 2]),dim2,
                ISINSCOPE('Var. Dims 1'[Var. Dims 1]),dim1,dim1)
VAR _result2 = IF(
                (selected_dim1 ="'Full Price Flag'[Full Price Flag Description]" || ISINSCOPE('Var. Dims 1'[Var. Dims 1 Felder])|| NOT ISINSCOPE('Var. Dims 2'[Var. Dims 2 Felder])&& NOT ISINSCOPE('Var. Dims 3'[Var. Dims 3 Felder]))||
                (selected_dim2 = "'Full Price Flag'[Full Price Flag Description]"|| NOT ISINSCOPE('Var. Dims 3'[Var. Dims 3 Felder]))||
                (selected_dim3 = "'Full Price Flag'[Full Price Flag Description]"), BLANK(),[EOH])

VAR _result3 =
    IF(
        (selected_dim1 ="'Full Price Flag'[Full Price Flag Description]" ) ||
        (selected_dim2 = "'Full Price Flag'[Full Price Flag Description]" ) ||
        (selected_dim3 = "'Full Price Flag'[Full Price Flag Description]"),
        IF(
            ISINSCOPE('Var. Dims 1'[Var. Dims 1]),
            IF(
                selected_dim1 <>  "'Full Price Flag'[Full Price Flag Description]",
                [EOH],
                BLANK()
            ),
            IF(
                ISINSCOPE('Var. Dims 2'[Var. Dims 2]),
                IF(
                    selected_dim2 <> "'Full Price Flag'[Full Price Flag Description]",
                    [EOH],
                    BLANK()
                ),
                IF(
                    selected_dim3 <>  "'Full Price Flag'[Full Price Flag Description]",
                    [EOH],
                    BLANK()
                )
            )
        ),
        [EOH]
    )
RETURN _result3

 

PLEASE can anybody help me with this?

1 ACCEPTED SOLUTION
perviiri
New Member

I found a solution. In case it would help anybody, here are 2 ways: _resulteTESTNEW and test12:

test EOH =

VAR selected_dim1 = SELECTEDVALUE('Var. Dims 1'[Var. Dims 1 Felder])

VAR selected_dim2 = SELECTEDVALUE('Var. Dims 2'[Var. Dims 2 Felder])

VAR selected_dim3 = SELECTEDVALUE('Var. Dims 3'[Var. Dims 3 Felder])

 

var _resultTESTNEW = IF(((selected_dim3 = "'Full Price Flag'[Full Price Flag Description]"||

            selected_dim2 = "'Full Price Flag'[Full Price Flag Description]"||

            selected_dim1 = "'Full Price Flag'[Full Price Flag Description]")&&ISINSCOPE('Full Price Flag'[Full Price Flag Description]))||

            ((selected_dim3 = "'Full Price Flag'[Full Price_Markdown Flag]"||

            selected_dim2 = "'Full Price Flag'[Full Price_Markdown Flag]"||

            selected_dim1 = "'Full Price Flag'[Full Price_Markdown Flag]")&&ISINSCOPE('Full Price Flag'[Full Price_Markdown Flag])),"",[EOH])

 

VAR test12=

               IF((SUMX( 'Var. Dims 1', [Var. Dims 1 Reihenfolge] ) in { 9, 10 }  || SUMX( 'Var. Dims 2', [Var. Dims 2 Reihenfolge] ) in { 9, 10 }  || SUMX( 'Var. Dims 3', [Var. Dims 3 Reihenfolge] ) in { 9, 10 })&&(ISINSCOPE('Full Price Flag'[Full Price Flag Description])||ISINSCOPE('Full Price Flag'[Full Price_Markdown Flag]))

         ,"",

[EOH])

 

 

RETURN test12

View solution in original post

1 REPLY 1
perviiri
New Member

I found a solution. In case it would help anybody, here are 2 ways: _resulteTESTNEW and test12:

test EOH =

VAR selected_dim1 = SELECTEDVALUE('Var. Dims 1'[Var. Dims 1 Felder])

VAR selected_dim2 = SELECTEDVALUE('Var. Dims 2'[Var. Dims 2 Felder])

VAR selected_dim3 = SELECTEDVALUE('Var. Dims 3'[Var. Dims 3 Felder])

 

var _resultTESTNEW = IF(((selected_dim3 = "'Full Price Flag'[Full Price Flag Description]"||

            selected_dim2 = "'Full Price Flag'[Full Price Flag Description]"||

            selected_dim1 = "'Full Price Flag'[Full Price Flag Description]")&&ISINSCOPE('Full Price Flag'[Full Price Flag Description]))||

            ((selected_dim3 = "'Full Price Flag'[Full Price_Markdown Flag]"||

            selected_dim2 = "'Full Price Flag'[Full Price_Markdown Flag]"||

            selected_dim1 = "'Full Price Flag'[Full Price_Markdown Flag]")&&ISINSCOPE('Full Price Flag'[Full Price_Markdown Flag])),"",[EOH])

 

VAR test12=

               IF((SUMX( 'Var. Dims 1', [Var. Dims 1 Reihenfolge] ) in { 9, 10 }  || SUMX( 'Var. Dims 2', [Var. Dims 2 Reihenfolge] ) in { 9, 10 }  || SUMX( 'Var. Dims 3', [Var. Dims 3 Reihenfolge] ) in { 9, 10 })&&(ISINSCOPE('Full Price Flag'[Full Price Flag Description])||ISINSCOPE('Full Price Flag'[Full Price_Markdown Flag]))

         ,"",

[EOH])

 

 

RETURN test12

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors