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
Hello, Looking for your best codes.
I wanted to get the previous month actual volume but it returns all blanks.
Please check my codes.
Solved! Go to Solution.
@Anonymous please try this code in a calculated column
=CALCULATE(SUM(Table3[Actual Volume]),ALLEXCEPT(Table3,Table3[Segment],Table3[Sub-Segment]),PREVIOUSMONTH(Table3[Month]))
@Anonymous , do you need a measure you can do this wauth date table, like given example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
this month =MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))
last MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
previous month value = CALCULATE(sum(''Table''[total hours value]),previousmonth('Date'[Date]))
diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
PREVIOUSMONTH return a table, not a scalar value, so it can not be compared with a date value.
@wdx223_Daniel thanks for that, do have any solution on this codes. I wanted to show the previous month of actual volume.
Thanks for your support
@Anonymous please try this code in a calculated column
=CALCULATE(SUM(Table3[Actual Volume]),ALLEXCEPT(Table3,Table3[Segment],Table3[Sub-Segment]),PREVIOUSMONTH(Table3[Month]))
@wdx223_Daniel thanks bro you made it. 🙂
By The way when we use allexcept that means it will not include or filter the sub-seg and segment ?
@Anonymous ALLEXCEPT means remove all filters on the table except the columns listed.
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 | |
| 6 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |