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,
Im looking to display a table that looks like this :
| Month | M -12 | M -11 | M -10 | M -9 | M -8 | M -7 | M -6 | M -5 | M -4 | M -3 | M -2 | M -1 | M 0 - MTD |
| INV | |||||||||||||
| DOH | |||||||||||||
| COGS |
For the M1 calculation will include dates between today-29 to today-59. M2 will be today-59 to today - 89. Is there a simpler way for me to do rather than creating a measure for each of it which will give me around 36 measures ?
Any help is appreciated.
Thanks in advance !
Solved! Go to Solution.
Hi @Velvetine27
>> calculation for past 30 days
I create an example for your reference, please try this,
Measure =
var _header= MAX('Dimension'[Dimension])
return
SWITCH(TRUE(),
_header="M 0 - MTD",SUMX(FILTER('Table','Table'[Date]<=TODAY() && 'Table'[Date]>= EDATE(TODAY(),-1)),[Value]), // -30 day
_header="M -1", SUMX(FILTER('Table','Table'[Date]< EDATE(TODAY(),-1) && 'Table'[Date]>= EDATE(TODAY(),-2)),[Value]),
_header="M -2", SUMX(FILTER('Table','Table'[Date]< EDATE(TODAY(),-2) && 'Table'[Date]>= EDATE(TODAY(),-3)),[Value])
)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @Velvetine27
>> calculation for past 30 days
I create an example for your reference, please try this,
Measure =
var _header= MAX('Dimension'[Dimension])
return
SWITCH(TRUE(),
_header="M 0 - MTD",SUMX(FILTER('Table','Table'[Date]<=TODAY() && 'Table'[Date]>= EDATE(TODAY(),-1)),[Value]), // -30 day
_header="M -1", SUMX(FILTER('Table','Table'[Date]< EDATE(TODAY(),-1) && 'Table'[Date]>= EDATE(TODAY(),-2)),[Value]),
_header="M -2", SUMX(FILTER('Table','Table'[Date]< EDATE(TODAY(),-2) && 'Table'[Date]>= EDATE(TODAY(),-3)),[Value])
)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
can you provide more detail about your expected result and paste it as a picture?
hey thanks for your reply. Im looking for something like this. Not sure if this clarifies much, but basically im looking to get this range until M-12.
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 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 17 | |
| 8 | |
| 8 | |
| 7 |