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.
I'm hoping I'm just making a simple mistake here. I created a sample file and was able to reproduce the issue i'm having in my working model. For some reason, both the DATEADD and PREVIOUSMONTH are not working as expected. I have a date table. I created a calc column in both my data table & date table called date key that is just the date as an integer. This is what i created the relationship on. Each time i try and get previous month numbers in a measure it returns the total sum of all months. Here is the sample file SAMPLE FILE
Hi @Caitlin_Knox,
what exactly are you trying to achieve? is it to get the column with previous month values like:
1 jan
2 feb
3 mar
4 apr
and so on??? or just what was the previous month?
My end goal is to create a measure where the current month total can be compared against the previous month in a kpi visual. This seems easy enough, but i got hung up on creating the previous month total. Here's my DAX if its helpful
I've triple checked the syntax, so I think it might have somethign to do with my relationship? Or how I've created the datekey. I've used this strategy in the past, however, with no weird issues.
PreviousMonthMRC = CALCULATE(SUM(Sheet1[MRC]),DATEADD('Date'[Date],-1,MONTH))
There is PreviousMonth function in DAX but for some reason, it doesn't work on my side but you can give it a shot.
I found a way around it so give it a try:
Previous Month Sales = CALCULATE(SUM('Sheet4 (2)'[Sales]),MONTH ('Sheet4 (2)'[Date] ) = MONTH ( TODAY () )-1)
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 |
---|---|
113 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |