Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a formula:
Solved! Go to Solution.
@Libbyb23 I would recommend using EOMONTH. You can use a pattern such as:
Measure =
VAR __Today = TODAY()
VAR __Max = EOMONTH( __Today, -6 )
VAR __Min = DATE( YEAR( __EOM6 ), MONTH( __EOM6 ), 1 )
VAR __Table = FILTER( ALL( 'Sales Data' ), [Date] >= __Min && [Date] <= __Max )
VAR __Result = SUMX( __Table, [sales price] )
RETURN
__Result
Or do you not have a Date column?
@Libbyb23 I would recommend using EOMONTH. You can use a pattern such as:
Measure =
VAR __Today = TODAY()
VAR __Max = EOMONTH( __Today, -6 )
VAR __Min = DATE( YEAR( __EOM6 ), MONTH( __EOM6 ), 1 )
VAR __Table = FILTER( ALL( 'Sales Data' ), [Date] >= __Min && [Date] <= __Max )
VAR __Result = SUMX( __Table, [sales price] )
RETURN
__Result
Or do you not have a Date column?
@Greg_Deckler this worked perfectly!! How would I update this to count working days for those time frames?
@Libbyb23 There is a NETWORKDAYS function in DAX now, or the old school way: Net Work Days - Microsoft Fabric Community
@Greg_Deckler I do have a date column! I will try this out today and get back to you.
@Libbyb23 Perhaps use a month offset column which has a 0 for the current month and adds/subtracts 1 for every month forward/back
Could you send me an example?
I use this in power Query:
#"Added Custom1" = Table.AddColumn(#"Inserted Quarter", "Month Offset", each (([Year]-Date.Year(Today))*12)
+([Month]-Date.Month(Today))),
Hi,
I am not sure which table I should put this. Should I do it on my date table or on my sales table?
I have it on my date table.
You may also want to look into using the DATEADD formula..
Hmm, its not working for me. I have tried the DATEADD with no success. Any ideas?
OKay thanks! I am trying it out now
I just figured it out, but still need help with a solution.
6month Prior = CALCULATE(SUM('Sales Data'[sales_price]), FILTER('Sales Data','Sales Data'[Month Match] = true && 'Sales Data'[Month if Matching] = [Current Month]-6))/ CALCULATE([# of WorkDays], FILTER('Date Key', 'Date Key'[Month] = [Current Month] -6))
it works except for 6+ months prior because we are in June (month 6) -6 is 0. But I need to now go back to 12/2023. Any ideas are appreciated!!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |