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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Kellef
Helper I
Helper I

Dynamic dateslicer with all days marked until today

Hello,

I have created a hierarchy of year, month and day.

I'm trying to get the date slicer set as the latest date dynamically today()).

But I'm also trying to make the date slicer select all days up to today, today(). Is this possible? I want to look at all the data up to today, and not per day. So that all days are checked in until today.

 

What i have created so far: 

Latest period = date(year(TODAY () ),MONTH ( TODAY ()),day(TODAY ())) (a column created in the Datedimension, and 
Period = IF (
 
        YEAR ( 'DimDate'[Date] ) = YEAR ('DimDate'[Latest period] )
 
        && MONTH ('DimDate'[Date]) = MONTH ( 'DimDate'[Latest period] ),'DimDate'[month],'DimDate'[month])
i use this in my dateslicer to enter the report on the latest year and month at the moment (and will put in day as soon i get an a good tip for this problem 🙂 ).

/Patrik


6 REPLIES 6
Kellef
Helper I
Helper I

Thank you, this is already what i have done, second part is that i want. example: today is 2024-03-13 , i want 2024 to be checked, the month to checked and all days until the 13 th to checked. is that possible?

Hi @Kellef 

You just need to change the measure to the following.

Measure = IF(YEAR(MAX('Table'[Date]))=YEAR(TODAY())&&MAX('Table'[Date])<=TODAY(),1,0)

Output

vxinruzhumsft_0-1710834094250.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Kellef_0-1710921607991.png

I want the dateslicer to look like this, ackumulated until today.
i tried youre way, but maby im missing something? 

best regards,
Patrik

Hi @Kellef 

If you want to achieve this, you can consider to use custom visual:pre-selected visual.

vxinruzhumsft_0-1710922362484.png

2.Create a table.

vxinruzhumsft_1-1710922426013.png

Then change the measure 

Measure = IF(YEAR(MAX('Table'[Date]))=YEAR(TODAY())&&MAX('Table'[Date])<=TODAY(),TRUE(),FALSE())

Then put the following fields to the visual.

vxinruzhumsft_2-1710922486290.png

 

Output

vxinruzhumsft_3-1710922498776.png

 

Note:It has limitation that it cannot put the hierarchy to the field.

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

the dates was marked until today, so in that case it worked. But unfortunality it didnt look so good and my sameperiodlastyear measures didnt calculate correctly with that type of slicer. 

But a good tip!
Thanks.

v-xinruzhu-msft
Community Support
Community Support

Hi @Kellef 

You can refer to the following example.

Sample data 

vxinruzhumsft_0-1710298539893.png

1.Create a measure

Measure = IF(EOMONTH(MAX('Table'[Date]),0)=EOMONTH(TODAY(),0),1,0)

2.Put the date hierarchy to the slicer,and put the meaure to the slicer visual filter.

vxinruzhumsft_2-1710298664621.png

 

vxinruzhumsft_3-1710298670213.png

 

Output

vxinruzhumsft_4-1710298680226.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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