Search code examples
powerbidaxdaxstudio

How to evaluate tables/filters in Dax Studio


I am wondering is it possible to see in Dax Studio (or other editor) which values are used to filter measure (evaluate expresion that returns table)? What I mean by that is I create a measure for example:

last 3 value = 
VAR DATES = DATESINPERIOD(calendar[date],LASTDATE(calendar[date]), -3,MONTH)
RETURN CALCULATE([sum value], DATES)

Now I would like to evalaute this expresion:

DATESINPERIOD(calendar[date],LASTDATE(calendar[date]), -3,MONTH)

in dax studio to see what values it produces that are later used in filtering. I have searched for syntax that would allow it but I have failed. This example measure from above is easy, but I have one thats complicated and having the abillity to see its intermediate steps would help a lot. Thanks in advance :)


Solution

  • You can use EVALUATE to return table expressions.

    EVALUATE
    DATESINPERIOD ( 'calendar'[date], LASTDATE ( 'calendar'[date] ), -3, MONTH )
    

    See the documentation for more examples:

    https://daxstudio.org/tutorials/writing-dax-queries/