Forum Discussion

Pbiuserr's avatar
Pbiuserr
Post Prodigy
4 years ago
Solved

Grouping one value in a chart

Hello, I have dimension table like down below and a measure to countrows from fact table for each representation (and LY in another meausure) Zone Category Europe Global Asia Global...
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

     

    One of ways to achieve this is to create a Axis table like below, and write a measure by using TREATAS function.

     

    Pleases check the below picture and the attached pbix file.

     

     

     

    Value measure: =
    SWITCH (
        TRUE (),
        SELECTEDVALUE ( 'Axis'[Axis] ) = "Local",
            CALCULATE (
                SUM ( 'Fact'[Value] ),
                TREATAS ( VALUES ( 'Axis'[Axis] ), Zone[Category] )
            ),
        CALCULATE (
            SUM ( 'Fact'[Value] ),
            TREATAS ( VALUES ( 'Axis'[Axis] ), Zone[Zone] )
        )
    )