cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
saranp780 Member
Member

How to select specific value?

Hi.

I have a problem with DAX. First thing first, I have a suite of example data like this.

 

PriceModelPriceModel
1202AA1202
1003BB1003
1801CC1801
1402DD1402
1402EE1402
1491FF1491
1001GG1001

 

My requirement is when I select Model on Slicer, it will show only lower prices. 

 

Such as when I select on model E(1402). Now the models A(1202), B(1003), D(1402), E(1402) and G(1001) are shown.

Then I want to change a filter to Model A. This case the models that lower prices also display (A, B and G)

 

Thank you for sharing your experience. 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to select specific value?

hi, @saranp780

    After my research, You can do this as below:

Step1:

add a fact model table and do not create the relationship with basic table

Table = VALUES(Table2[Model])

drag the filed Model of Table into slicer

Step2:

Add a measure as below:

 

Measure = var _filter=CALCULATE(MAX(Table2[Price]),FILTER(ALL(Table2),SELECTEDVALUE('Table'[Model])=Table2[Model])) return
CALCULATE(MAX(Table2[PriceModel]),Table2[Price]<=_filter)

Step3:

when you do not select any model:

If you do want to show any data 

then drag measure into the visual level filter and set is not blank

6.PNG

If you do want to show all data 

then add a new measure

Measure 2 = IF(ISFILTERED('Table'[Model]),[Measure],MAX(Table2[PriceModel]))

then drag measure 2 into the visual level filter and set is not blank

7.PNG

Result:

8.PNG

After select model

9.PNG

here is pbix, please try it.

https://www.dropbox.com/s/r7rdj3xfh5tvt34/How%20to%20select%20specific%20value.pbix?dl=0

 

Best Regards,

Lin

 

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: How to select specific value?

hi, @saranp780

    After my research, You can do this as below:

Step1:

add a fact model table and do not create the relationship with basic table

Table = VALUES(Table2[Model])

drag the filed Model of Table into slicer

Step2:

Add a measure as below:

 

Measure = var _filter=CALCULATE(MAX(Table2[Price]),FILTER(ALL(Table2),SELECTEDVALUE('Table'[Model])=Table2[Model])) return
CALCULATE(MAX(Table2[PriceModel]),Table2[Price]<=_filter)

Step3:

when you do not select any model:

If you do want to show any data 

then drag measure into the visual level filter and set is not blank

6.PNG

If you do want to show all data 

then add a new measure

Measure 2 = IF(ISFILTERED('Table'[Model]),[Measure],MAX(Table2[PriceModel]))

then drag measure 2 into the visual level filter and set is not blank

7.PNG

Result:

8.PNG

After select model

9.PNG

here is pbix, please try it.

https://www.dropbox.com/s/r7rdj3xfh5tvt34/How%20to%20select%20specific%20value.pbix?dl=0

 

Best Regards,

Lin

 

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 112 members 1,515 guests
Please welcome our newest community members: