Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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 @Anonymous
Have you had the chance to check my solution?
Hi @Anonymous
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
)
Hi @Anonymous
Have you had the chance to check my solution?
thanks for helping. It works fine.
@Anonymous
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 |
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 9 | |
| 8 | |
| 8 |