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.
I created a slicer with two items (Supplier 1 and Supplier 2), I was trying to count the selected items from this slicer, but what I found is that the count result would be the same when I selected both or de-selected both.
The measure I created is: CountSupplier = COUNTROWS(FILTERS('Sheet1'[Supplier Name]))
When I selected both:
When I selected neither item:
I need the measure give the count result '0' when I de-select both.
Solved! Go to Solution.
Hi @Anonymous
Would you like Page1 or Page2?
Page1
Page2
Measure 2 = IF(HASONEVALUE(Table1[name]),[Measure],SUMX(Table1,[Measure])) Measure 3 = SUMX(ALL(Table1),[Measure])
This works not only for tow items but also work for more.
Best Regards
Maggie
How to have the column "value" in Table 1? Should I sipmy add a columns and fill with "1"? If I do this, I do not see the symbol "Σ" next to value. Thank you
Hi @Anonymous
Create a new table and don't connect this table to other tables
Table2 = VALUES(Table1[name])
Add Table2[name] in the slicer, add Table1[name] in the table visual.
create a measure in Table1
Measure = IF(ISFILTERED(Table2[name])&&SELECTEDVALUE(Table1[name]) in VALUES(Table2[name]),1,0)
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Maggie,
When I selected both items in the slicer, I need the measure give result of '2' instead of '0'. Here is a list for the measure results I want:
Select NO item: measure = 0
Select 1 item: measure = 1
Select 2 item: measure = 2
...
Actually here I just gave an example of 2 items in the slicer, what about if there are more items in the slicer?
Thanks!
Michael
Hi @Anonymous
Would you like Page1 or Page2?
Page1
Page2
Measure 2 = IF(HASONEVALUE(Table1[name]),[Measure],SUMX(Table1,[Measure])) Measure 3 = SUMX(ALL(Table1),[Measure])
This works not only for tow items but also work for more.
Best Regards
Maggie
Yes this 'Measure 2' and 'Measure 3' work well! thanks a lot! I prefer to use 'Measure 2'.
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 |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |