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! Learn more
Hello everyone,
How can i create a measure to show current month and previous month sale from Northwind Traders dataset
Link download dataset: https://maven-datasets.s3.amazonaws.com/Northwind+Traders/Northwind+Traders.zip
Solved! Go to Solution.
Hi @NQT1711
Please try the following Dax:
Current Month Sales =
CALCULATE (
SUM ( 'Northwind Traders'[Total_sale] ),
FILTER (
ALL ( 'Northwind Traders' ),
MONTH ( 'Northwind Traders'[Date] )
= MONTH ( SELECTEDVALUE ( 'Northwind Traders'[Date] ) )
)
)
Last Month Sales =
VAR current_month =
MONTH ( SELECTEDVALUE ( 'Northwind Traders'[Date] ) )
RETURN
CALCULATE (
SUM ( 'Northwind Traders'[Total_sale] ),
FILTER (
ALL ( 'Northwind Traders' ),
MONTH ( 'Northwind Traders'[Date] ) = current_month - 1
)
)
Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @NQT1711
Please try the following Dax:
Current Month Sales =
CALCULATE (
SUM ( 'Northwind Traders'[Total_sale] ),
FILTER (
ALL ( 'Northwind Traders' ),
MONTH ( 'Northwind Traders'[Date] )
= MONTH ( SELECTEDVALUE ( 'Northwind Traders'[Date] ) )
)
)
Last Month Sales =
VAR current_month =
MONTH ( SELECTEDVALUE ( 'Northwind Traders'[Date] ) )
RETURN
CALCULATE (
SUM ( 'Northwind Traders'[Total_sale] ),
FILTER (
ALL ( 'Northwind Traders' ),
MONTH ( 'Northwind Traders'[Date] ) = current_month - 1
)
)
Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |