This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hello,
I have a very simple messure:
TotalSalesBlue = SUMX(FILTER('Sales','Sales'[COLOR]="BLUE"),'Sales'[AMT])
Sales Table is connect with Date Table via DateID.
I'm trying to find Only PreviousMonth, PreviousQuarter Data using Following formula:
PreviousMonthBlueSlaes= CALCULATE ([TotalSalesBlue] , PREVIOUSMONTH(DATE[Date_Id]))
I'm geeting all the months, but I'm only looking for previous month sum.
Thanks in advance.
Solved! Go to Solution.
Hi,
Explore relative dates filters
Hi,
If you modify your TotalSalesBlue measure to this, do you get the correct result.
=CALCULATE(SUM('Sales'[AMT]),'Sales'[COLOR]="BLUE")
Even after modifying the result I get all month
1- Changed messured as you suggested, still getting all months as shown below. I'm need to only get 9/30/2018 data.
hi, @Anonymous
You may try to this way as below:
Step1:
Add a year month column in date table
Year Month Number = YEAR ( 'Date'[Date] ) * 100 + MONTH ( 'Date'[Date] )
Step2:
modify the formula
PreviousMonthBlueSlaes = CALCULATE ([TotalSalesBlue] , PREVIOUSMONTH('Date'[Date]), 'Date'[Year Month Number]=YEAR(TODAY())*100+MONTH(TODAY())-2)Result:
Before
After
Best Regards,
Lin
Hi,
Explore relative dates filters
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 32 | |
| 26 | |
| 25 | |
| 24 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 48 | |
| 27 | |
| 23 | |
| 20 |