Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 |
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
40 | |
27 | |
20 | |
15 | |
8 |
User | Count |
---|---|
71 | |
48 | |
46 | |
20 | |
16 |