使用DAX计算以前日期(月中和月末)的销售额 [英] calculate sales for previous dates (mid-month and end month) using DAX

查看:727
本文介绍了使用DAX计算以前日期(月中和月末)的销售额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对DAX非常陌生,我希望获得前几个月的销售额。如您所见,日期是:每月的15号和每月的最后一天。谁能帮我吗?



我希望将日期用作过滤器,选择日期时,我希望该度量值能给我上一个结果日期。



解决方案

确定。感谢您发布此信息。对其进行工作非常有启发性。我已经附上了power bi文件的副本和pdf



这可能不是您可以使用的解决方案...它确实显示了当月收到的金额和当月的总计(月份显示为数字)



我使用的核心技巧是创建2个计算值每行一列,一个月15日,另一行。我根据行中的日期字段的样子在行中填充零或数量。

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


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.

解决方案

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

这篇关于使用DAX计算以前日期(月中和月末)的销售额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆