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 have a measure that returns me 2 words:
"Sold" or "Unsold"
I wanna create a slicer like the following and when user click on button, the slicer filter a visual table showing only the products selected (The products sold or the unsold or both, if user select both options, like a normal slicer)
But, like as you know, I can't put a mesure on a slicer, it needs to be a real column.
How can I create this slicer?
I search on internet and find something about create a exclusive table with 1 column and 2 lines (Sold and Unsold), put this column on a slicer and create a measure to link them, but I don't know if this solution works for my problem, or it works but I don't know how to implement them.
Thanks
Solved! Go to Solution.
Hi @gluizqueiroz ,
As you refer you need to create a table with two lines:
Sold
Unsold
Then create a measure similar to this:
FIlter data = IF ( COUNT ( 'Sold/Unsold'[Cat] ) > 1; 1; IF ( MAX ( 'Sold/Unsold'[Cat] ) = "Sold"; COUNTX ( FILTER ( SUMMARIZE ( Sales; Sales[Product]; "Sold"; [Sold/Unsold] ); [Sold] = "Sold" ); [Sold] ); COUNTX ( FILTER ( SUMMARIZE ( Sales; Sales[Product]; "Unsold"; [Sold/Unsold] ); [Unsold] = "Unsold" ); [Unsold] ) ) )
Be aware that this measure is based on way to count the rows of products that have sold or unsold, but the resul will be simply 1 per row.
I then used this to filter the table visual to get the final result.
Check PBIX file attach.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @gluizqueiroz ,
As you refer you need to create a table with two lines:
Sold
Unsold
Then create a measure similar to this:
FIlter data = IF ( COUNT ( 'Sold/Unsold'[Cat] ) > 1; 1; IF ( MAX ( 'Sold/Unsold'[Cat] ) = "Sold"; COUNTX ( FILTER ( SUMMARIZE ( Sales; Sales[Product]; "Sold"; [Sold/Unsold] ); [Sold] = "Sold" ); [Sold] ); COUNTX ( FILTER ( SUMMARIZE ( Sales; Sales[Product]; "Unsold"; [Sold/Unsold] ); [Unsold] = "Unsold" ); [Unsold] ) ) )
Be aware that this measure is based on way to count the rows of products that have sold or unsold, but the resul will be simply 1 per row.
I then used this to filter the table visual to get the final result.
Check PBIX file attach.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |