Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dosania
Helper II
Helper II

Help with dynamic filtering

Hi,

I would like to introduce some dynamic filtering into my dashboard, where I have 2 filters that help select the final value shown. The first filter should narrow down the range the second filter gives the options users can see. I’m having trouble writing the first piece of DAX which will narrow down the selection of measures to select from, and the second which selects the subset from the first subset.

 

I started with the second filter, which shows values by sales type, but the team then wanted to split this to see Sales including/excluding commission.


The first set of data/measures looks like the following;

NameFieldFilter
Gross IncGross sales inc commissionInclude Commision
Gross ExGross sales Ex commissionInclude Commision
Net IncNet sales inc commissionInclude Commision
Net ExNet sales inc commissionInclude Commision
Signed IncSigned sales inc commissionInclude Commision
Signed ExSigned sales inc commissionInclude Commision



Sales Commision =
var _commisionType = SELECTEDVALUE('Include Commision'[ParameterSelect])

RETURN
switch(_commisionType, "Yes", [Sales Inc Commision],
"No", [Sales Ex Commision],
[Blank])



The final subset from the first selection will look like the following;

 

Measure NameField NameFilter
Gross SalesGross SalesSales Type
Net SalesNet SalesSales Type
Signed SalesSigned SalesSales Type


Reporting Sales =
var _salesType = SELECTEDVALUE('Sales Type'[Name])

RETURN
switch(_salesType, "Gross Sales", [Gross Sales],
"Signed Sales", [Signed Sales"],
"Net Sales", [Net Sales],
[Blank])

 


I was wondering if someone could advise the best way to structure the data and write the DAX to get the final output to show in my tables and cards for users to see this information?

Thanks

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @dosania 

According to your description, you want to create two filters in your dashborad. Right?

The data you provide doesn't look like your raw data, and I don't quite understand your business needs and desired end result.
If you want to create two filters, and the result of the second filter is the result of the first filter, then you need to make sure that there is a hierarchical relationship between the two fields.

And these two fields need to be in one table, because measures cannot be placed in the filter.

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.