Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |