Forum Discussion

Giadev's avatar
Giadev
Frequent Visitor
5 years ago
Solved

Add hidden fixed value to a filter

Hi, I need to add some hidden fixed values to a filtered selection.   This s my table: Account Value A 10 B 22 C 23 D 44 Z 45 Z 56 Z 78 Slicer with hidde...
  • v-luwang-msft's avatar
    5 years ago

    HGiadev ,

    Is this what you want to get, when you select A at the slicer, you get the data of A plus the data sum of Z. If you select B at the slicer, you get the data of B plus the data sum of Z.If soYou could try the following dax to create a measure:

    measure =
    VAR sumz =
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Account] = "Z" )
        )
    VAR TABLE2 =
        CALCULATETABLE (
            VALUES ( 'Table'[Account] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[Account] = SELECTEDVALUE ( 'Table'[Account] )
            )
        )
    VAR last =
        IF ( MAX ( 'Table'[Account] ) IN TABLE2SUM ( 'Table'[Value] ) + sumz"" )
    RETURN
        last

     

    final you will get the below:

     

     

     

    Wish  it is helpful for you!

     

    Best Regard

    Lucien Wang