Forum Discussion
Anonymous
7 years agoNot applicable
INDIRECT function in DAX
Hi all, I have a problem. I want to create a dynamic measure in DAX that will depend of the name of the variable. I have a table with column names display like this Month 1, Month 2,..... Month n, ...
Ashish_Mathur
7 years agoSuper User
Hi,
Assuming you have a Calendar table with Year and Month columns in there, build a relationship from the Date column of your Data Table to the Date column of the Calendar Table. Create 2 slicers - one for Year and another for Month - select any one Year and Month. Write these measures
Total = SUM(Data[Amount])
Total for this and previous month = CALCULATE([Total],DATESBETWEEN(Calendar[Date],EDATE(MIN(Calendar[Date]),-1),MAX(Calendar[Date])))
Hope this helps.