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
I have this report where I show total sales per month, and the growth % from previous month.
As you can see, I have all months on my data slicer. If I hide a month, the calculation still considers the previous month, even if it is hidden. So for example, if I select 2023-01 and 2023-03, it calculates my 2023-03 Growth % based on my 2023-02 month, even if it is hidden.
I want it to calculate based on the previous visible month. So, for example, if I select 2023-01 and 2023-03, the Growth % metric should be calculated considering 2023-01, not 2023-02.
Here is my metric:
Solved! Go to Solution.
You can use OFFSET for this.
Here is an example of how you could update the measure (PBIX attached):
Sales Growth % Monthly (Visible Months) =
VAR CurrentSales = [TotalSales]
VAR VisibleMonths =
CALCULATETABLE (
VALUES ( dim_calendar[Year-Month] ),
ALLSELECTED ( dim_calendar )
)
VAR PreviousSales =
CALCULATE (
[TotalSales],
OFFSET ( -1, VisibleMonths ),
REMOVEFILTERS ( dim_calendar )
)
RETURN
IF (
NOT ISBLANK ( PreviousSales ),
DIVIDE ( CurrentSales - PreviousSales, PreviousSales, 0 ),
BLANK ( )
)
Note that dim_calendar[Year-Month] could be replaced with any column of the same granularity that sorts correctly, e.g. "Start of Month".
Does this work for you?
You can use OFFSET for this.
Here is an example of how you could update the measure (PBIX attached):
Sales Growth % Monthly (Visible Months) =
VAR CurrentSales = [TotalSales]
VAR VisibleMonths =
CALCULATETABLE (
VALUES ( dim_calendar[Year-Month] ),
ALLSELECTED ( dim_calendar )
)
VAR PreviousSales =
CALCULATE (
[TotalSales],
OFFSET ( -1, VisibleMonths ),
REMOVEFILTERS ( dim_calendar )
)
RETURN
IF (
NOT ISBLANK ( PreviousSales ),
DIVIDE ( CurrentSales - PreviousSales, PreviousSales, 0 ),
BLANK ( )
)
Note that dim_calendar[Year-Month] could be replaced with any column of the same granularity that sorts correctly, e.g. "Start of Month".
Does this work for you?
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!