Forum Discussion

Mannai's avatar
Mannai
Icon for Helper I rankHelper I
4 years ago
Solved

Adding Axe category to measure

hello everyone 

 

 

under this photo you can see that i calculated each of these bar columns with a measure but i want to show the visual like this : 


is there a possible way to do it by adding category to the measures?

  • Hello Mannai ,

     

    I am assuming you have three measures as Femmes, Hommes and Key People.
    Please follow below steps-

     

    Step 1.

    Create a table with name MeasureTable and column "MeasrureName" having three rows- Femmes, Hommes and Key People. 

     

     

    Step 2- Create Measure as-

    Measure = 
    VAR A = SELECTEDVALUE(MeasureTable[MeasureName])
    Return
    SWITCH(A,"Femmes",[Femmes],
            "Hommes",[Hommes],
            "Key People",[Key People])

     

    Step 3- In bar chart in axis show MeasureName column from the table created and use above measure in values.

     

     

    Please mark it as answer if it resolves your issue. Kudos are also appreciated.

     

3 Replies

  • Hello Mannai ,

     

    I am assuming you have three measures as Femmes, Hommes and Key People.
    Please follow below steps-

     

    Step 1.

    Create a table with name MeasureTable and column "MeasrureName" having three rows- Femmes, Hommes and Key People. 

     

     

    Step 2- Create Measure as-

    Measure = 
    VAR A = SELECTEDVALUE(MeasureTable[MeasureName])
    Return
    SWITCH(A,"Femmes",[Femmes],
            "Hommes",[Hommes],
            "Key People",[Key People])

     

    Step 3- In bar chart in axis show MeasureName column from the table created and use above measure in values.

     

     

    Please mark it as answer if it resolves your issue. Kudos are also appreciated.

     

  • I would probably try using the axis, as ribisht17 suggested

    I'm guessing the reason you're using measures is to aggregate multiple categories into the "main" categories: Homme, Femme, Key people. 

    What i would do is go and create a Calculated Column, that does this aggregation and use this new colum on the axis