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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Modify DayOffset Slicer

Hi, I'm using dayoffset column from my Date table to filter visuals in the report. For one of my tabs in the report, I'm using the day offset as a slicer but it doesn't look intuitive or user friendly compared to the default relative date slicer. Is there a way to make the day offset slicer look similar to the default relative date slicer?
Appreciate any help @tamerj1 @vapid128 

qsmith83_0-1658645089001.png

qsmith83_1-1658645130029.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I've solved the issue by adding a blank query called "Now" that specifies the timezone and then referencing that "Now" query in the Date table i.e. the "Current date" step in power query.

image (1).pngimage.png

View solution in original post

12 REPLIES 12
vapid128
Solution Specialist
Solution Specialist

OK  I don think my way gonna work for you. 

Unless you want to rewirte all measures.

Anonymous
Not applicable

@vapid128 I appreciate your help and feedback but is there another way without rewriting all measures? If not possible, then it's okay I'll seek further advise from other members in the forum.

vapid128
Solution Specialist
Solution Specialist

[line] is another measure,

line= countrows(dw_orders)

 

image.png

Anonymous
Not applicable

@vapid128 , you have date table linked to one table for your example so countrows will be for 'dw_orders' table only. I will be linking to multiple tables - how do I accomplish that?

Try make all relationship cross filter diretion both.

 

If it does not work, can you pos all your table relationships?

Anonymous
Not applicable

@vapid128 I'm not comfortable setting cross filter to 'both' direction as it may cause ambiguity with results when filtering. I direct messaged you with link to pbix file. Hope that's okay. 

If you report or dateset refresh daily, 

we can try build today() function in colnum.

And numbers refresh daily.

Anonymous
Not applicable

@vapid128 yes the data is auto refreshed daily by power automate

Anonymous
Not applicable

Hi @vapid128 do you have an update please?

vapid128
Solution Specialist
Solution Specialist

image.png

 

Is this what you want? 

 

Create 4 tables

First:

type

day
week(Mon-Sun)
Month

 

Second:
Next/Last

Next
Last

 

Third:

VALUE = GENERATESERIES(0,100)
Fourth:
dateTable = CALENDAR(MIN(dw_orders[date]),MAX(dw_orders[date]))
 
In dateTable create colnums:
MonthIndex = YEAR([Date])*12+MONTH([Date])
WeekIndex(MtoS) = int(([Date]-2)/7)
 
Create Measure:
Measure =
var _NextLast = IF(SELECTEDVALUE('Next/Last'[Next/Last])="Last",-1,1)

return
SWITCH(TRUE(),
    SELECTEDVALUE('type'[type])="Month" ,
    CALCULATE(
        [lines],
        FILTER(
            'dateTable',
            dateTable[MonthIndex]= year(TODAY())*12 + MONTH(TODAY())+SELECTEDVALUE('VALUE'[Value])*_NextLast
        )
    ),
    SELECTEDVALUE('type'[type])="week(Mon-Sun)" ,
    CALCULATE(
        [lines],
        FILTER(
            'dateTable'
            ,dateTable[WeekIndex(MtoS)]=  int((TODAY()-2)/7)+SELECTEDVALUE('VALUE'[Value])*_NextLast
        )
    ),
    CALCULATE(
        [lines],
        FILTER(
            'dateTable',
            dateTable[Date]=  TODAY()+SELECTEDVALUE('VALUE'[Value])*_NextLast
        )
    )
)
Anonymous
Not applicable

@vapid128 thanks for this but I have one question - in your 'Measure' function, what does [lines] represent??

Date Offset Slicer =
var _NextLast = IF(SELECTEDVALUE('Date Slicer-Next/Last'[Next/Last]) ="Last",-1,1)

return
SWITCH(TRUE(),
    SELECTEDVALUE('Date Slicer-Type'[Type])="Month" ,
    CALCULATE(
        [lines],
        FILTER(
            'Calendar Offset',
            'Calendar Offset'[Month Index]= year(TODAY())*12 + MONTH(TODAY())+SELECTEDVALUE('VALUE'[Value])*_NextLast
        )
    ),
    SELECTEDVALUE('Date Slicer-Type'[Type])="Week" ,
    CALCULATE(
        [lines],
        FILTER(
            'Calendar Offset'
            ,'Calendar Offset'[Week Index]=  int((TODAY()-2)/7)+SELECTEDVALUE('VALUE'[Value])*_NextLast
        )
    ),
    CALCULATE(
        [lines],
        FILTER(
            'Calendar Offset',
            'Calendar Offset'[Date]=  TODAY()+SELECTEDVALUE('VALUE'[Value])*_NextLast
        )
    )
)

 

qsmith83_1-1658781167791.png

 

Anonymous
Not applicable

I've solved the issue by adding a blank query called "Now" that specifies the timezone and then referencing that "Now" query in the Date table i.e. the "Current date" step in power query.

image (1).pngimage.png

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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