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.
Good day everyone,
Maybe someone could help me. I have the following table
ID | STORE | MODEL | SIZE | CODE_NUM | RCODE | SCODE |
0 | STORE_08 | DIAMOND | TALL | 502609 | MEN | MTGGTG |
0 | STORE_08 | PLATINUM | TALL | 1312314 | WOMEN | ACGUSG |
1 | STORE_09 | DIAMOND | SHORT | 775 | WOMEN | DMEHNE |
2 | STORE_10 | DIAMOND | SMALL | 775 | WOMEN | DMEHNE |
3 | STORE_11 | PLATINUM | STANDARD | 1989707 | MEN | UD1DE1 |
3 | STORE_11 | PLATINUM | STANDARD | 532715 | WOMEN | RCNGBN |
3 | STORE_11 | PLATINUM | STANDARD | 502991 | MEN | MTGGTG |
3 | STORE_11 | PLATINUM | TALL | 120631 | MEN | AW6US6 |
3 | STORE_11 | PLATINUM | TALL | 1320334 | MEN | NOT IN STOCK |
3 | STORE_11 | PLATINUM | TALL | 31234 | MEN | UD1DE1 |
3 | STORE_11 | PLATINUM | TALL | 47259 | MEN | MTGGTG |
I'd like to get the count of unique (distincts) SCODES when ID = 5, RCODE = MEN and MODEL = PLATINUM
If in SCODE there are values = NOT IN STOCK then should be counted apart. Then the output I'm looking for is like this:
Total Distincts = 3 UD1DE1,MTGGTG,AW6US6 NOT IN STOCK = 1 1320334
If NOT IN STOCK = 0 and Total Distincts = 0 then the output would be
Total Distincts = 0
If NOT IN STOCK = 0 then and Total Distincts > 0 the output would be
Total Distincts = N (Where N > 0)
I've tried a measure like below but is not working
Measure = IF(VALUES(PRODS[SCODE]<>"NOT IN STOCK"), DISTINCTCOUNT(PRODS[SCODE]), COUNTAX(PRODS[SCODE],PRODS[SCODE]="NOT IN STOCK"))
Thanks in advance for any help
Hi @cgkas ,
You could replace "VALUES" with "SELECTEDVALUE" because "VALUES" will return multi values in your case.
Hello, thanks for your answer.
I changed to SELECTEDVALUE, but is always showing 8, when should be 6.
IF(SELECTEDVALUE(PRODS[SCODE])<>"NOT IN STOCK", DISTINCTCOUNT(PRODS[SCODE]))
May someone could help me with this question please.
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 |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |