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
I have visual where I want the table to say 'Current Month vs Last Month' with the month names changing dynamically based on slicer value.
What I have currently is this:
Solved! Go to Solution.
@atowriss99 Assuming you meant Feb 2023 vs. Jan 2023 and making various other assumptions about your data model then perhaps something like this:
Current v Prior Month =
VAR __CurDate = MAX('Date'[Date])
VAR __CurMonth = SELECTEDVALUE('Date'[Month Name Short])
VAR __CurYear = SELECTEDVALUE('Date'[Year])
VAR __PrevDate = EOMONTH(__CurDate, -1)
VAR __PrevMonth = FORMAT(__PrevDate, "mmm")
VAR __PrevYear = YEAR(__PrevDate)
VAR __Result = __CurMonth & " " & __CurYear & " versus " & __PrevMonth & " " & __PrevYear
RETURN
__Result
@atowriss99 Assuming you meant Feb 2023 vs. Jan 2023 and making various other assumptions about your data model then perhaps something like this:
Current v Prior Month =
VAR __CurDate = MAX('Date'[Date])
VAR __CurMonth = SELECTEDVALUE('Date'[Month Name Short])
VAR __CurYear = SELECTEDVALUE('Date'[Year])
VAR __PrevDate = EOMONTH(__CurDate, -1)
VAR __PrevMonth = FORMAT(__PrevDate, "mmm")
VAR __PrevYear = YEAR(__PrevDate)
VAR __Result = __CurMonth & " " & __CurYear & " versus " & __PrevMonth & " " & __PrevYear
RETURN
__Result
Exactly what I wanted!
Thanks!
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.