Forum Discussion

TheCreepster1's avatar
TheCreepster1
Icon for Helper II rankHelper II
8 years ago
Solved

Distinct Count based on percentage measure

Hi All,

 

Not sure if what I'm trying to achieve is possible but I have some information at Site/SKU level where I am performing some aggregate calculations that I then want to perform a distinct count on.

 

Below is some example data:

 

 

The aggregate calculation looks to see if the site should have this SKU in stock, and places a 1/0 flag based on the result. It then calculates to see what % of SKUs are available:

 

 

Now those two bits I can do without problem, and they successfully change with any selected filters, but I'm trying to get to a point where I can see how many Sites fit within a percentage band to give a table like the below:

 

 

I'm very new to DAX and Power BI so don't know if this is something that can be done? Any hints or pointers will be much appreciated.

 

 

  • Some sort of nested IF would probably work for this if you've only got a small number of options to work with - something like:

     

    PercentageGroup = if([currentpercentagemeasure]<0.6,"50-60%",if([currentpercentagemeasure]<0.7,"60-70%"

     

    and so on

1 Reply

  • jthomson's avatar
    jthomson
    Icon for Solution Sage rankSolution Sage

    Some sort of nested IF would probably work for this if you've only got a small number of options to work with - something like:

     

    PercentageGroup = if([currentpercentagemeasure]<0.6,"50-60%",if([currentpercentagemeasure]<0.7,"60-70%"

     

    and so on