The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi everyone,
I don't know if it's a bug in the Power Bi Slicer or if I'm doing something wrong.
I need to create a data slicer to vary the data between the minimum and maximum value for a specific product, so I created a Slicers for him.
When I set the maximum value, it removes all contracts from the SQSLL product, but if I set the minimum SQSLL value, it removes all contracts from other products.
I looked for a solution and didn't find it.
Could someone help me with this please?
Power BI Sales slicer Product.pbix
thanks
Solved! Go to Solution.
You only have a single table. Your slicers will overlay (ie both will be applied together) when they filter your data.
Use disconnected tables for your slicer and then use measures as visual filters for your tables A and B.
Hi @lbendlin ,thanks for your quick reply, I will add more.
Hi @mscla ,
As @lbendlin said, you need to create a disconnected table for slicer.
Please follow these steps:
1.Use the following DAX expression to create a table.
Table = CALCULATETABLE(VALUES('table Sales'[Sales]),'table Sales'[Product] = "CQSSL")
2.Use the following DAX expression to create a measure
Measure =
VAR _product = SELECTEDVALUE('table Sales'[Product])
VAR _minforSlicer = MIN('Table'[Sales])
VAR _maxforSlicer = MAX('Table'[Sales])
VAR _result = IF(_product <> "CQSSL",
SUM('table Sales'[Sales]),
SUMX(FILTER('table Sales','table Sales'[Sales] >= _minforSlicer && 'table Sales'[Sales] <= _maxforSlicer),[Sales])
)
RETURN _result
3.Final out put
Best Regards,
Wenbin Zhou
If this post helps, please mark me and @lbendlin as the solution.
Thank you very much @lbendlin and @v-zhouwen-msft
Really appreciate your help, and its really worked!
My goal is to have a slicer for each product that the user can increase or decrease for each product. so, I created a combinedMeasure and its working
Hi @lbendlin ,thanks for your quick reply, I will add more.
Hi @mscla ,
As @lbendlin said, you need to create a disconnected table for slicer.
Please follow these steps:
1.Use the following DAX expression to create a table.
Table = CALCULATETABLE(VALUES('table Sales'[Sales]),'table Sales'[Product] = "CQSSL")
2.Use the following DAX expression to create a measure
Measure =
VAR _product = SELECTEDVALUE('table Sales'[Product])
VAR _minforSlicer = MIN('Table'[Sales])
VAR _maxforSlicer = MAX('Table'[Sales])
VAR _result = IF(_product <> "CQSSL",
SUM('table Sales'[Sales]),
SUMX(FILTER('table Sales','table Sales'[Sales] >= _minforSlicer && 'table Sales'[Sales] <= _maxforSlicer),[Sales])
)
RETURN _result
3.Final out put
Best Regards,
Wenbin Zhou
If this post helps, please mark me and @lbendlin as the solution.
You only have a single table. Your slicers will overlay (ie both will be applied together) when they filter your data.
Use disconnected tables for your slicer and then use measures as visual filters for your tables A and B.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
80 | |
80 | |
48 | |
40 |
User | Count |
---|---|
150 | |
110 | |
64 | |
64 | |
57 |