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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
kreiss
Frequent Visitor

Weeks Since Store Opening Slider

Howdy!

 

I have a client that want's a dashboard of store inventory in the weeks preceding new store openings and after store opening.

 

I was able to accomplish this by adding a start date to the store file then creating the following measure:

Weeks Before Opening =

VAR OpenDate = Min(POSStore[Store Opening Date])
VAR FilterDate = min('Date'[Date])

Return
DATEDIFF(OpenDate,FilterDate,WEEK)

 

This works fine when I assign a filter to each store visual that includes that measure...not the most efficient...but it worked.

 

But now the client wants a slider with the # of weeks prior to (or after) opening so they can compare the stores inventory levels on a week by week basis both prior to opening and after opening.

 

Since I can't drop the measure into a slider...any thoughts on the easiest way to accomplish this???

1 ACCEPTED SOLUTION
kreiss
Frequent Visitor

I found a video that showed how to do this.

This was solved by creating an non-related table called "WeeksFromOpen" with one field (also called "WeeksFromOpen" containing just the numbers -10 thru 10.

I then dropped that field into a slider with range (eg -4 weeks before opening to 3 weeks after opening) and created the following measure:

Measure Filter =
Var MinValue = Min(WeeksFromOpen[WeeksFromOpen])
VAR MaxValue = Max(WeeksFromOpen[WeeksFromOpen])
VAR CurrentMeasureValue = [Weeks Before Opening]
RETURN
IF(CurrentMeasureValue >= MinValue && CurrentMeasureValue<= MaxValue,
1,
0
)

 

I could then drop this measure into the filter visuals and show only those that calculated as "1".

Just wanted to close the loop.

 

Thanks all.

View solution in original post

1 REPLY 1
kreiss
Frequent Visitor

I found a video that showed how to do this.

This was solved by creating an non-related table called "WeeksFromOpen" with one field (also called "WeeksFromOpen" containing just the numbers -10 thru 10.

I then dropped that field into a slider with range (eg -4 weeks before opening to 3 weeks after opening) and created the following measure:

Measure Filter =
Var MinValue = Min(WeeksFromOpen[WeeksFromOpen])
VAR MaxValue = Max(WeeksFromOpen[WeeksFromOpen])
VAR CurrentMeasureValue = [Weeks Before Opening]
RETURN
IF(CurrentMeasureValue >= MinValue && CurrentMeasureValue<= MaxValue,
1,
0
)

 

I could then drop this measure into the filter visuals and show only those that calculated as "1".

Just wanted to close the loop.

 

Thanks all.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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