Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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:
Best Regards,
Lin
Hi,
Explore relative dates filters
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |