Forum Discussion

dinesh_ch's avatar
dinesh_ch
Regular Visitor
7 years ago
Solved

pass slicer value to Filter inside CalculatedTable expression

Hello,

 

I have a table with below structure and slicer with MonthNum

 

Metric  MonthNum

10         1

40         2

70         3

100       4

20         5

 

Based on the selection of single slicer value, i need to get above table data having MonthNum less than or equal to slicer selected value.

If 3 is selected in slicer, i need to populate table dynamically as below

 

Metric  MonthNum

10         1

40         2

70         3

 

Tried with this DAX expression, but its not giving correct output.

DynamicTable = CALCULATETABLE('Actualtable',FILTER('Actualtable','Actualtable'[MonthNum] <= SELECTEDVALUE('Slicer'[MonthNum]))

 

Can you please help.

Thanks

4 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    dinesh_ch

     

    Slicers do not affect calculated tables or calculated columns since these are computed when data is first loaded and are static until data is refreshed.

     

    Try using MEASURES instead.

    • dinesh_ch's avatar
      dinesh_ch
      Regular Visitor

      Thanks for the response.

      Can you please help me in formulatig the query using measure to achieve the functionality.