Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
MaxShema
Regular Visitor

Shift of Start Period

Hi, friends.

I have a table in Power BI with the columns Object, Item, Period, and Value. I have a pivot table visualization where I have rows from Items, columns from Period, and values from Value. I also have a Measure

 

ShiftedValue =
VAR CurrentPeriod = SELECTEDVALUE('Pro Forma1'[StartPeriod])
VAR ShiftPeriod = CALCULATE(MIN('Pro Forma1'[StartPeriod]), ALL('Pro Forma1')) - SELECTEDVALUE('Period'[StartPeriod], BLANK())
RETURN
CALCULATE(
SUM('Pro Forma1'[Value]),
'Pro Forma1'[StartPeriod] = CurrentPeriod + ShiftPeriod
)

 

that allows me to have a Period slicer such that if I select a specific period on this slicer, that period becomes the first period for the pivot table. For example, if initially the first period is 2026, and I select 2024 on the slicer, then all values of 2026 become values of 2024, values of 2027 become values of 2025, values of 2028 become values of 2026, and so on.

 

However, I am facing a challenge.

I need to be able to add another slicer that will allow me to select values from the Object column for which the shift specified in the Period slicer will apply. If an object is not one of the ones selected in the Object slicer, then the shift should not be performed.

 

Any ideas on how to achieve this?

Thank you in advance!

 

2 REPLIES 2
aduguid
Super User
Super User

Give this a try

ShiftedValue =
VAR CurrentPeriod = SELECTEDVALUE('Pro Forma1'[StartPeriod])
VAR ShiftPeriod = CALCULATE(MIN('Pro Forma1'[StartPeriod]), ALL('Pro Forma1')) - SELECTEDVALUE('Period'[StartPeriod], BLANK())
VAR SelectedObjects = VALUES('Pro Forma1'[Object])
RETURN
CALCULATE(
    SUM('Pro Forma1'[Value]),
    'Pro Forma1'[StartPeriod] = CurrentPeriod + ShiftPeriod,
    'Pro Forma1'[Object] IN SelectedObjects
)

Thank you for reply.

Yes, I tried such way, but unfortunately it doesn't work. Such measure will filter only those objects, that are in SelectedObjects and remove from the pivot table those, that are not there. But I need to have all objects in the pivot table, but the shift would to be applied only for those that are in SelectedObjects.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.