Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Need help

Hi,

I'm trying to show values in clustered column chart in the below manner.

 

 

My client wants to see 100% for each Market listed in the chart instead of showing 100% for all markets. The value is derived from the Count of emps.

 

Any help on this would be really appreciated!!

Regards,

Mahesh

  • Hi, Anonymous 

     

    I briefly simulated some data to hopefully fit your needs.

    Measure:

    Percentage =
    DIVIDE (
        CALCULATE (
            COUNT ( 'Table'[Emp ID] ),
            FILTER (
                ALL ( 'Table' ),
                [Market] = SELECTEDVALUE ( 'Table'[Market] )
                    && [Emp ID] = SELECTEDVALUE ( 'Table'[Emp ID] )
            )
        ),
        CALCULATE (
            COUNT ( 'Table'[Emp ID] ),
            FILTER ( ALL ( 'Table' ), [Market] = SELECTEDVALUE ( 'Table'[Market] ) )
        )
    )
    

    Is this the result you expect, showing 100% by each market?

     

    Best Regards,

    Community Support Team _Charlotte

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

5 Replies

  • Anonymous , a new Measure

     

    assume you have measure for which you want this %

     

    divide([measure], calculate([measure], removefilters(Table[Legend Column]))

     

    Use the legend column in remove filters

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak there's no measure created for this. We're showing the % of grand total in the chart

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, Anonymous 

     

    Can you provide some of the example data for testing? What do you expect the results to look like, and can you also show them in pictures?

     

    Best Regards

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-zhangti ,

       

      As you can see in the picture I posted in my message, I'm % of emps in each market. I didn't create any measure for this. I used the count of emps and showed the value as %GT of Emps on the chart.

       

      The new requirement is that I need to show % of emps as 100% for each market instead of segregating the total value across markets.

       

      Below is a measure that can help me do that but I'm looking for something more dynamic which can be used for all markets in a single measure.

       

      Buildings = calculate( Count(Emp ID), Market = "Buildings")

      Please let me know if we have a way to do this calculation for all markets in a dynamic way.

       

      Regards,

      Mahesh

      • v-zhangti's avatar
        v-zhangti
        Community Support

        Hi, Anonymous 

         

        I briefly simulated some data to hopefully fit your needs.

        Measure:

        Percentage =
        DIVIDE (
            CALCULATE (
                COUNT ( 'Table'[Emp ID] ),
                FILTER (
                    ALL ( 'Table' ),
                    [Market] = SELECTEDVALUE ( 'Table'[Market] )
                        && [Emp ID] = SELECTEDVALUE ( 'Table'[Emp ID] )
                )
            ),
            CALCULATE (
                COUNT ( 'Table'[Emp ID] ),
                FILTER ( ALL ( 'Table' ), [Market] = SELECTEDVALUE ( 'Table'[Market] ) )
            )
        )
        

        Is this the result you expect, showing 100% by each market?

         

        Best Regards,

        Community Support Team _Charlotte

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