March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
14 | |
11 | |
8 | |
5 |
User | Count |
---|---|
26 | |
21 | |
20 | |
14 | |
10 |