Forum Discussion
Filter Month with last month data
Hi Anonymous
I used your pbix for test.
The [Measure] is created by you not me.
What i created are as below
To show previous month total separately and selected month separately,
Besides these measures above, create two measures
previous_month_total = CALCULATE(SUM(sasw[Total]),FILTER(ALL(sasw),[month_diff]=-1)) selected_month_total = CALCULATE(SUM(sasw[Total]),FILTER(ALL(sasw),[month_diff]=0))
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- v-juanli-msftCommunity Support
Hi Anonymous
Create a new table without relationship with any other table
FY 2019_created_byme = FILTER(ADDCOLUMNS(CALENDARAUTO(),"month-year",FORMAT([Date],"mmmm_yyyy")),DAY([Date])=1)
Create measures in sasw
selected month&&year = SELECTEDVALUE('FY 2019_created_byme'[Date]) month_diff = DATEDIFF([selected month&&year],MAX(sasw[As of Date]),MONTH) selected_month_total+previous = CALCULATE(SUM(sasw[Total]),FILTER(ALL(sasw),[month_diff]=0||[month_diff]=-1))add [month-year] from table "FY 2019_created_byme" in the slicer
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- AnonymousNot applicable
Thanks for your guidance, i wish to show previous month total separately and selected month separately. not sum of both. Also the measure name "Measure " which you created is not changing it's value . it should be reflect selected month total
- v-juanli-msftCommunity Support
Hi Anonymous
I used your pbix for test.
The [Measure] is created by you not me.
What i created are as below
To show previous month total separately and selected month separately,
Besides these measures above, create two measures
previous_month_total = CALCULATE(SUM(sasw[Total]),FILTER(ALL(sasw),[month_diff]=-1)) selected_month_total = CALCULATE(SUM(sasw[Total]),FILTER(ALL(sasw),[month_diff]=0))
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.