Forum Discussion

BradAF's avatar
BradAF
Helper I
5 years ago
Solved

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...
  • AllisonKennedy's avatar
    5 years ago
    You'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.
  • AllisonKennedy's avatar
    AllisonKennedy
    5 years ago
    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