Forum Discussion

TRPBI's avatar
TRPBI
New Member
4 years ago
Solved

DAX Query

Hello, I need your help please. i have a column i created with the dax, the values for example A, AB, ABC, BC, C, B, AC, i need to create a filter that shows me A, B, C A : when the values are A, ...
  • v-yanjiang-msft's avatar
    4 years ago

    Hi TRPBI ,

    According to your description, here’s my solution.

    1.Create a table, there’s no relationship between the two tables.

     

    2.Create a measure.

    Result =

    SWITCH (

        SELECTEDVALUE ( 'Table (2)'[Type] ),

        "A",

            CALCULATE (

                SUM ( 'Table'[Value] ),

                FILTER ( 'Table', [Tag] IN { "AB", "A", "ABC" } )

            ),

        "B",

            CALCULATE (

                SUM ( 'Table'[Value] ),

                FILTER ( 'Table', [Tag] IN { "AB", "ABC", "BC", "B" } )

            ),

        "C",

            CALCULATE (

                SUM ( 'Table'[Value] ),

                FILTER ( 'Table', [Tag] IN { "ABC", "BC" } )

            )

    )

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.