Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
I am trying to write a Dax where I can Filter the page based on the selected discount. I want see the all discounted products details based on the discount selected .
That is if I select 20%, I want to see all the products that are discounted up to 20%
Firstly I made a table with these discount fields to use as a filter. Then I created a calculated Column in my Main Table using the Dax below
Solved! Go to Solution.
@vedika1089 I would recommend a disconnected table for your slicer and then a Complex Selector measure: The Complex Selector - Microsoft Fabric Community
Hi, @vedika1089
Based on your description, I created the following sample data:
Table:
Discount table:
I use the following DAX to calculate Sales under each discount:
Discount Sales =
VAR _discount =
SELECTEDVALUE ( Discount[Discount] )
RETURN
IF (
_discount = BLANK (),
CALCULATE ( SUM ( 'Table'[Sales] ) ),
CALCULATE ( SUM ( 'Table'[Sales] ) * _discount )
)
Place the product and this measure in the table visual, and place the discount field of the Discount table in the slicer:
When selecting different discounts, the corresponding sales will be calculated, and the results are as follows:
I have provided the PBIX file used this time. I hope it will be helpful to you.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Li,
My desired result is different
Let me know if this helps.
Thank you
@vedika1089 I would recommend a disconnected table for your slicer and then a Complex Selector measure: The Complex Selector - Microsoft Fabric Community
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 12 | |
| 9 | |
| 5 | |
| 5 |