Forum Discussion

AGScottThompson's avatar
AGScottThompson
Frequent Visitor
4 years ago
Solved

Clustered Chart Group Total

How do you calculate a percent based on a group? I am trying to figure out the percentage of each value in a group in a cluster chart. Each Bar should be the percentage relative to the group not the entire data set.
 
Here is where I am at:
ClientCount = DISTINCTCOUNT('Real Estate Final'[Client])
ALLClientCount = CALCULATE('GeneralMeasure'[ClientCount],ALLselected('Real Estate Final'))
ClientCountPCT = GeneralMeasure[ClientCount]/GeneralMeasure[ALLClientCount]
 
Current
 
This is the example I need to create (sorry about the unreadable numbers)
<1M         34%,64%,2%
$1-4.9M   33%,62%,5%
 
Target

4 Replies

  • SpartaBI's avatar
    SpartaBI
    Community Champion

    AGScottThompson try this:

     

    ClientCount = DISTINCTCOUNT('Real Estate Final'[Client])
    ALLClientCountInDescription = CALCULATE([ClientCount],REMOVEFILTERS('Real Estate Final'), VALUES('Real Estate Final'[Description]))
    ClientCountPCT = [ClientCount]/[ALLClientCountInDescription]

     





          

    Showcase Report – Contoso By SpartaBI

  • That is almost working for me, but I need to add 2 filters in.  I tried 

    ALLClientCountInDescription = CALCULATE([ClientCount],REMOVEFILTERS('Real Estate Final'),VALUES('Year'[Year]) ,VALUES(RealEstate_TIVBandSort[Description])  )
     
    But it does not apppear to be working.