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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ramesh_1991
New Member

Need help urgently for Dynamic DAX. I want to created two dynamic slicers shown in image

Requirement.png

 

How to created both Slicers 1 & 2 which will slice the data in main table

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

To get the Score Slicer, I would recommend creating a disconnected table with all of the possible values in those columns - if you are 100% sure that there will only be a set number of values, you can pretty much hard code it. Something like:

Score Values = {0, 1, 2}

Or if you know a range, then consider GENERATESERIES().

You will then need to create a measure for each of your columns - i.e 

alcohol abuse = 
var toReturn = SUM(Table[alcohol abuse])
return IF(toReturn in VALUES('Score Values'[Value]), toReturn, BLANK())
// ... and repeat for the rest of the columns

you need the IF condition to hide a value if it hasn't been selected in the slicer. This is a bit tedious, but only needs to be done once.
For your Measure Name slicer - create a field parameter, and just use the measures that you've created above.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @ramesh_1991 ,

Did @vicky_ 's suggestions help with your scenario? if that is the case, you can consider Kudo or accept his suggestions to help others who faced similar requirements.

If that also doesn't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

ramesh_1991
New Member

client_idalcohol_abuseblood_loos_anemiacardiac_arrythmiasrenal_failure
51310000
69820000
113870000
114170000
172500000
183670000
208130010
218520000
218550000
222010010
226560000
231920000
232550000
233470000
234760000
243660000
246450000
248650010
vicky_
Super User
Super User

To get the Score Slicer, I would recommend creating a disconnected table with all of the possible values in those columns - if you are 100% sure that there will only be a set number of values, you can pretty much hard code it. Something like:

Score Values = {0, 1, 2}

Or if you know a range, then consider GENERATESERIES().

You will then need to create a measure for each of your columns - i.e 

alcohol abuse = 
var toReturn = SUM(Table[alcohol abuse])
return IF(toReturn in VALUES('Score Values'[Value]), toReturn, BLANK())
// ... and repeat for the rest of the columns

you need the IF condition to hide a value if it hasn't been selected in the slicer. This is a bit tedious, but only needs to be done once.
For your Measure Name slicer - create a field parameter, and just use the measures that you've created above.

aduguid
Super User
Super User

Can you paste example data for the table?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.