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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
A measure that shows us months until curent month +1 or curent month -1 and if we will get 1 (current month -1) or 2 (current month +1) like in picture below
Solved! Go to Solution.
Ok, I'm assuming you wish to show the periods you mention for the current year (if no, you will need to adapt the measures accordingly)
First the date table, which includes a column for YearMonth (which is used to set the periods for the current year)
.
Next create two measures, one for each period you need (the metric I'm showing in this example is the [sum of sales]
Current Month - 1 =
VAR _Prev =
YEAR ( TODAY () ) * 100
+ MONTH ( TODAY () ) - 1
RETURN
IF ( MAX ( 'Date Table'[YearMonth] ) <= _prev, [Sum Sales] )
Current Month + 1 =
VAR _Prev =
YEAR ( TODAY () ) * 100
+ MONTH ( TODAY () ) + 1
RETURN
IF ( MAX ( 'Date Table'[YearMonth] ) <= _prev, [Sum Sales] )
Go into the "New Parameter" option under "Modeling" in the ribbon and select "Fields". Give the Parameter a name and drag both the measures into the"Add and reorder fields" box
This creates a new table as you can see in the Fields list, and will automatically add a slicer to the report:
Set up yur visual with the year and month fields from the date table and add the [Period Sel] to the Y-axis to get:
I've attached the sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
Hi @Anonymous ,
Whether the advice given by @PaulDBrown has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.
Looking forward to your feedback.
Best Regards,
Henry
Are you going to select the period via a slicer?
Proud to be a Super User!
Paul on Linkedin.
Yep
Ok, I'm assuming you wish to show the periods you mention for the current year (if no, you will need to adapt the measures accordingly)
First the date table, which includes a column for YearMonth (which is used to set the periods for the current year)
.
Next create two measures, one for each period you need (the metric I'm showing in this example is the [sum of sales]
Current Month - 1 =
VAR _Prev =
YEAR ( TODAY () ) * 100
+ MONTH ( TODAY () ) - 1
RETURN
IF ( MAX ( 'Date Table'[YearMonth] ) <= _prev, [Sum Sales] )
Current Month + 1 =
VAR _Prev =
YEAR ( TODAY () ) * 100
+ MONTH ( TODAY () ) + 1
RETURN
IF ( MAX ( 'Date Table'[YearMonth] ) <= _prev, [Sum Sales] )
Go into the "New Parameter" option under "Modeling" in the ribbon and select "Fields". Give the Parameter a name and drag both the measures into the"Add and reorder fields" box
This creates a new table as you can see in the Fields list, and will automatically add a slicer to the report:
Set up yur visual with the year and month fields from the date table and add the [Period Sel] to the Y-axis to get:
I've attached the sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!