Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I've got a table that I want to filter based on what a Slicer selection returns.
The context is that I have a slicer table that looks like this:
MIN VIEWS |
100 |
150 |
200 |
250 |
The customer should be able to pick one of the MIN VIEWS through the slicer and be returned a table with only the rows which are over the selected amout of Views.
My code looks like this:
Filtered Table = CALCULATETABLE('datatable'), FILTER('datatable', 'datatable'[Visits] > SELECTEDVALUE('MIN Views'[MIN VIEWS]) ) )
The selection works, as you can see below, however the filter won't work (e.g. all rows from the datatable are displayed in the new table.
Thanks in advance,
Leon
Solved! Go to Solution.
@Anonymous add measure as below and in table visual, drop product and this new measure, you will have solution
Views Total = VAR __selectedValue = SELECTEDVALUE( Table2[MinViews] ) RETURN CALCULATE( SUM( Table3[Views] ), Table3[Views] >= __selectedValue )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous you cannot use slicer value in calculatetable, you need to create measure and use that in a table visual to show the data.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k wrote:@Anonymousyou cannot use slicer value in calculatetable, you need to create measure and use that in a table visual to show the data.
Hi Parry,
thanks for your reply.
Unfortunately I do not quite understand what you mean with creating a measure and using that in a table visual.
I just created a Measure that gives me the selected views, and tried using that as a filter instead - it didn't work either. Can you explain a bit more in depth?
Thank you for your help!
Leon
@Anonymous it will be much easier to provide an answer if you post sample data with expected output.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k wrote:@Anonymousit will be much easier to provide an answer if you post sample data with expected output.
@parry2k Thats a good Idea. So I have this table:
MIN VIEWS |
100 |
150 |
200 |
250 |
and this table.
Product ID | Views |
1 | 500 |
2 | 300 |
3 | 450 |
4 | 30 |
5 | 20 |
My expected Output is a new table, that dependant on some form of selection tool, gives me this output:
Product ID | Views |
1 | 500 |
3 | 450 |
Thanks,
Leon
@Anonymous add measure as below and in table visual, drop product and this new measure, you will have solution
Views Total = VAR __selectedValue = SELECTEDVALUE( Table2[MinViews] ) RETURN CALCULATE( SUM( Table3[Views] ), Table3[Views] >= __selectedValue )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi All,
I am having the same issue and fairly new to dax. I am trying show the numbers based on the selected option in slicer and I am not getting any luck.
So far, here is the dax that I have but incomplete:
@parry2k wrote:@Anonymousadd measure as below and in table visual, drop product and this new measure, you will have solution
Views Total = VAR __selectedValue = SELECTEDVALUE( Table2[MinViews] ) RETURN CALCULATE( SUM( Table3[Views] ), Table3[Views] >= __selectedValue )
@parry2k That works quite well, thank you. However when I add any other columns, new Products come into the table. Any chance I can prevent that? So then the output looks like this:
Product ID | Views Total | Price |
1 | 500 | 50 |
2 | 60 | |
3 | 450 | 10 |
4 | 22 | |
5 | 12 |
I don't want 2,4,5 in the table though, because I'm working with and visualizing the numbers...
Thanks,
Leon
@Anonymous in visual level filter, in measure , choose great than zero.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi i have more or less the same problem.. https://community.powerbi.com/t5/DAX-Commands-and-Tips/FILTER-TABLE-BASED-ON-SELECTED-VALUE/m-p/1075...
But it doesnt work for me this solution.
Can you help ?
@parry2k wrote:@Anonymousin visual level filter, in measure , choose great than zero.
Thank you parry!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
129 | |
106 | |
106 | |
86 | |
72 |