Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Solved! Go to Solution.
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.
OK I don think my way gonna work for you.
Unless you want to rewirte all measures.
@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.
[line] is another measure,
line= countrows(dw_orders)
@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?
@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.
Is this what you want?
Create 4 tables
First:
type
day |
week(Mon-Sun) |
Month |
Second:
Next/Last
Next |
Last |
Third:
@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
)
)
)
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.
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
7 |