user5950313
user5950313

Reputation:

Display last 12 months

I am lookking to display the last 12 months and the data for selected month. If a user selects december 2019, it will dsipaly all months from december 2018 till december 2019. enter image description here

Example 

enter image description here

Here is the pbix file https://drive.google.com/file/d/1WBOolZIFNTWQsPt_QvCY5OAmdy80lHzm/view?usp=drivesdk

Upvotes: 0

Views: 124

Answers (1)

user9824134
user9824134

Reputation: 410

Make sure that your Label_Month table is not connected to your fact table. Also, click on "Modeling" in the desktop editor and "Manage Relationships"; make sure that the filter value for Label_Month is not limiting your output table. Make sure that there is an actual date value being selected in Label_Month table; if there is not one add it. You will do the date limiting in the measure value that you aggregate. This measure assumes that you are summing, but you can use other operators in Calculate.

Measure = VAR StartDate = DATEADD(MAX(Label_Month(ActualDate)),-1,year) VAR EndDate = MAX(Label_Month(ActualDate)) RETURN CALCULATE( SUM(Column), FILTER( ALL(Label_Month), Label_Month(ActualDate) >= StartDate && Label_Month(ActualDate) <= EndDate ) )

Upvotes: 1

Related Questions