Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I try to generate month to date based on my customized logic.
As below, I would like to generate a measure in "Ordered Qty MTD" based on "Weeknum&year&month" column which is generated based on "Date" column. In the visualization, I tried to use time inteliigence, but still fail. Wonder if you could help?
My intention is to only list down by "Weeknum&year&month", "Material No", "Ordered Qty" and "Ordered Qty MTD" columns without showing date, but time intelligence dax would not allow to do so. Thanks.
Solved! Go to Solution.
Hi @LisaChung
Please try
Qty MTD =
VAR CurrentDate =
MAX ( TableName[Date] )
VAR StartOfMonth =
DATE ( YEAR ( CurrentDate ), MONTH ( CurrentDate ), 1 )
RETURN
CALCULATE (
SUM ( TableName[Ordered Qty] ),
ALLEXCEPT ( TableName, TableName[Material No] ),
TableName[Date] <= CurrentDate,
TableName[Date] >= StartOfMonth
)
thanks for helping. It works fine.
@LisaChung
Do you have a datetable? is [Weeknum&year&month] a column? In which table?
Hi @tamerj1
This is the only table I have. I made "Weeknum&year&month" column on my own.
They are all in this table. Thanks
Date | Weeknum&year&month | Material No | Ordered Qty |
2022/05/01 | Week 1 of May | A | 0 |
2022/05/02 | Week 2 of May | A | 3650 |
2022/05/03 | Week 2 of May | A | 23650 |
2022/05/04 | Week 2 of May | A | 2900 |
2022/05/05 | Week 2 of May | A | 450 |
2022/05/06 | Week 2 of May | A | 20550 |
2022/05/07 | Week 2 of May | A | 400 |
2022/05/09 | Week 3 of May | A | 1900 |
2022/05/10 | Week 3 of May | A | 3500 |
2022/05/11 | Week 3 of May | A | 850 |
2022/05/12 | Week 3 of May | A | 1100 |
2022/05/13 | Week 3 of May | A | 250 |
User | Count |
---|---|
41 | |
27 | |
23 | |
19 | |
16 |
User | Count |
---|---|
55 | |
35 | |
21 | |
18 | |
15 |