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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Dynamic segment date

Hello,

In my reports, I use a segment with the date to permit to users to change the date and analyse the period they need. But I would want that the date was automatically changed each morning where the dataset is refreshed.

For example, on 25/03/2023, the segment must be 01/01/2023 to 24/03/2023 ; on 26/03/2023,  the segment must be 01/01/2023 to 25/03/2023...

For this, I use a second segment with a filter on a "Default period" which is calculated in my calendar table. It works but it is not user friendly because the user has to change two segments to modify the date and the interaction between the two segments is not clear for all users.

Is there a better solution ?

Thanks

2 REPLIES 2
Anonymous
Not applicable

@amitchandak, thank you for your answer.

I'm sorry, I think that what I need wasn't enough clear. I hope it will be clearer with this example.

Damien_fra_0-1680095760442.png

Here, it is what I do in order to have the results from 01/01/2023 to 28/03/2023 and to permit to the dashboard users to change the date and, for example, analyse 01 2022 to 12 2022 if they need. Tomorrow, the date will be 01/01/2023 to 29/03/2023 because my measure "Default Period" return "Yes" from the 1st day of the year to today()-1.

But, for the dashboard users, when they want to change the date, it is confusing to have to put"Period default = yes or no" and, after, to change the date. I would want to have only a segment with a date without a second segmet with "Default Period". Is it clearer ? Do you have a solution for this ?

amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

QTD =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today()) -1
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
return
CALCULATE([net] ,Filter('Date','Date'[Date]>= _min && 'Date'[Date] <= _max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors