Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello Everyone,
I hope you are all doing well,
I am stuck at a problem and can't find a ways out. I have a sample table with shops name, target and date. Based on the target a dax measure is written which which will define the category for that particular shop.
for example if I select date between 1 december, 20222 to 2 decemeber 2022 than the category of a1 store will be "D" however if choose date upto 3 december , 2022 the category of a1 store will be "A". Following dax is used to assign the category.
--------------------------------------------------------------------------------
Now I want to count the total number of stores fall in a specefic category based show the total against those stores with respect to the chosen date and show blank in total for category and for count.
The output should be like this.
Kindly help
Solved! Go to Solution.
Hi @spartansquad
Please refer to attached sample file with the solution
Count of Category =
VAR CurrentCategory = [Category]
RETURN
SUMX (
ALLSELECTED ( 'Table'[Shop] ),
IF (
[Category] = CurrentCategory,
1
)
)
It worked for me thank you
Hi @spartansquad
Please refer to attached sample file with the solution
Count of Category =
VAR CurrentCategory = [Category]
RETURN
SUMX (
ALLSELECTED ( 'Table'[Shop] ),
IF (
[Category] = CurrentCategory,
1
)
)
User | Count |
---|---|
14 | |
10 | |
7 | |
6 | |
5 |
User | Count |
---|---|
30 | |
19 | |
12 | |
7 | |
5 |