calculate sales for previous dates (mid-month and end month) using DAX

♀尐吖头ヾ 提交于 2019-12-24 18:32:21

问题


I am very new to DAX and i want sum of sales for the previous months. As you can see, the dates are : The 15th of every month and the last day of every month. Can anyone please help me?

I want when i use the date as a filters , when i chose a date, i want the measure to give me the results of the previous date.


回答1:


Have you tried making a calculated column that shows the "previous date" for each date. If that is successful then possibly you could return the result using the date from the "previous date" calculated column when the row with a date was selected.




回答2:


OK. Thanks for posting this. Working on it has been very instructive. I've attached a copy of my power bi file and a pdf

this may not be a solution you can use... it does show both amounts received during the month and the total for the month (months are displayed as numbers)

The core trick I used was to create 2 calculated columns for each row, one for the 15th the other for the end of the month. I populated them with a zero or the amount in the row depending on what the date field in the row looked like. that gave me amounts i could summarize.

https://drive.google.com/file/d/1hdM5QKonEft4sYk2yyD0JLlXJcEb3baU/view?usp=sharing



来源:https://stackoverflow.com/questions/57338137/calculate-sales-for-previous-dates-mid-month-and-end-month-using-dax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!