Forum Discussion
BradAF
5 years agoHelper I
Using SELECTEDVALUE with Calculated Table workaround?
Hello, I have a report that currently shows how many items were added to a database during a scan and the difference compared to the previous run. Clicking on any date in the graph changes the to...
- 5 years agoYou've created that DAX as a table correct?
Only Measures will recalculate based on slicer selection, so you will need to use that table inside a MEASURE dax formula, then it will respond to your slicer selection without need a refresh.
Challenge is just getting the items down to one 'scalar' value, so you may find CONCATENATEX to be helpful here. - 5 years agoBradAF
Glad the workaround is helping a bit.
Unfortunately, REFRESH only refreshes the data model data, not the slicer inputs. Power BI order of operations is basically as follows:
Raw data source updates/changes
Power Query operations (M code)
DAX tables and columns
Slicers
DAX measures
When you click Refresh, it will go back to the Raw data source and check for updates, apply the query changes from Power Query, then calculate that DAX tables and columns and THEN apply the slicer selections.
You may be able to use the PowerApps visual to ask the user for an input and then need to use that input inside the Power Query filter (using M NOT DAX). Then when you click refresh it will take that selection into account. This would be using Parameters inside Power Query, in combination with the PowerApps add in.
https://radacad.com/power-query-parameters-vs-what-if-parameters-power-bi-implementation-use-cases/?ref=818
https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-powerapp
AllisonKennedy
5 years agoCommunity Champion
BradAF
Glad the workaround is helping a bit.
Unfortunately, REFRESH only refreshes the data model data, not the slicer inputs. Power BI order of operations is basically as follows:
Raw data source updates/changes
Power Query operations (M code)
DAX tables and columns
Slicers
DAX measures
When you click Refresh, it will go back to the Raw data source and check for updates, apply the query changes from Power Query, then calculate that DAX tables and columns and THEN apply the slicer selections.
You may be able to use the PowerApps visual to ask the user for an input and then need to use that input inside the Power Query filter (using M NOT DAX). Then when you click refresh it will take that selection into account. This would be using Parameters inside Power Query, in combination with the PowerApps add in.
https://radacad.com/power-query-parameters-vs-what-if-parameters-power-bi-implementation-use-cases/?ref=818
https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-powerapp
Glad the workaround is helping a bit.
Unfortunately, REFRESH only refreshes the data model data, not the slicer inputs. Power BI order of operations is basically as follows:
Raw data source updates/changes
Power Query operations (M code)
DAX tables and columns
Slicers
DAX measures
When you click Refresh, it will go back to the Raw data source and check for updates, apply the query changes from Power Query, then calculate that DAX tables and columns and THEN apply the slicer selections.
You may be able to use the PowerApps visual to ask the user for an input and then need to use that input inside the Power Query filter (using M NOT DAX). Then when you click refresh it will take that selection into account. This would be using Parameters inside Power Query, in combination with the PowerApps add in.
https://radacad.com/power-query-parameters-vs-what-if-parameters-power-bi-implementation-use-cases/?ref=818
https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-powerapp
BradAF
5 years agoHelper I
Thanks, Allison, for the information on the order of operations - that helps a lot with trying to understand what's going on!
I tried poking around briefly at the parameters and I think the PowerQuery parameters may be my best bet to get a dynamically generated list of dates to use, so I will keep poking at that.
Thanks again!
- AllisonKennedy5 years agoCommunity Champion
You're welcome. Enjoy Power Query parameters - they're fun, and feel free to shout out if you get stuck or confused.