Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
In PowerBI, I am trying to figure out how to perform a count of stores based upon the percentage groups
For example, if all 4 months are selected
The desired result would be:
100% = 3 stores
75% = 1 store
50% = 2 stores
This count/percentage would then change if different months were selected.
For example, if only months 1 through 3 were selected...
...then the count would be:
100% = 3 stores
66.7% = 3 stores
Solved! Go to Solution.
You can use the following measure. This measure works when adding it to a visual which has [Store] column. If the visual doesn't have the [Store] column, the variable _pcnt cannot get the correct result then COUNTROWS would probably return a blank result.
Count_PCNT =
var _t = SUMMARIZE(ALLSELECTED('Table'),'Table'[Store],"PCNT",[PCNT_Measure])
var _pcnt = [PCNT_Measure]
return
COUNTROWS(FILTER(_t,[PCNT]=_pcnt))
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
You can use the following measure. This measure works when adding it to a visual which has [Store] column. If the visual doesn't have the [Store] column, the variable _pcnt cannot get the correct result then COUNTROWS would probably return a blank result.
Count_PCNT =
var _t = SUMMARIZE(ALLSELECTED('Table'),'Table'[Store],"PCNT",[PCNT_Measure])
var _pcnt = [PCNT_Measure]
return
COUNTROWS(FILTER(_t,[PCNT]=_pcnt))
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Sample Data
Store | Month | Schedule | Visit |
Store #01 | 2022_01 | 1 | 1 |
Store #01 | 2022_02 | 1 | 1 |
Store #01 | 2022_03 | 1 | 1 |
Store #01 | 2022_04 | 1 | 1 |
Store #02 | 2022_01 | 1 | 1 |
Store #02 | 2022_02 | 1 | |
Store #02 | 2022_03 | 1 | 1 |
Store #02 | 2022_04 | 1 | 1 |
Store #03 | 2022_01 | 1 | 1 |
Store #03 | 2022_02 | 1 | 1 |
Store #03 | 2022_03 | 1 | |
Store #03 | 2022_04 | 1 | |
Store #04 | 2022_01 | 1 | 1 |
Store #04 | 2022_02 | 1 | 1 |
Store #04 | 2022_03 | 1 | 1 |
Store #04 | 2022_04 | 1 | 1 |
Store #05 | 2022_01 | 1 | 1 |
Store #05 | 2022_02 | 1 | 1 |
Store #05 | 2022_03 | 1 | 1 |
Store #05 | 2022_04 | 1 | 1 |
Store #06 | 2022_01 | 1 | |
Store #06 | 2022_02 | 1 | 1 |
Store #06 | 2022_03 | 1 | 1 |
Store #06 | 2022_04 | 1 |
User | Count |
---|---|
53 | |
28 | |
19 | |
18 | |
14 |
User | Count |
---|---|
92 | |
86 | |
39 | |
23 | |
22 |