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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
kumsha1
Post Patron
Post Patron

Date flag based on slicer selection and Dynamic measure values

Hi,

 

Is it possible to create a Date flag based on Date slicer selection. Flag should only have Current Date (i.e. slicer value) and previous Date of slicer Date. My requirement is to use a measure along with this flag that will automatically change values for Current/Previous Dates based on slicer selection. TIA.

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @kumsha1 ,

Based on your description, you need to create another date table and use it as a slicer:

Table = DISTINCT('Calendar'[Date])

Create this tag measure:

Tag =
VAR date1 =
    SELECTEDVALUE ( 'Table'[Date] )
VAR date2 =
    SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
    IF ( date2 <= date1, 1, 0 )

re.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @kumsha1 ,

Based on your description, you need to create another date table and use it as a slicer:

Table = DISTINCT('Calendar'[Date])

Create this tag measure:

Tag =
VAR date1 =
    SELECTEDVALUE ( 'Table'[Date] )
VAR date2 =
    SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
    IF ( date2 <= date1, 1, 0 )

re.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@kumsha1 , for that you can create measure like this, assume the date is from date table

This Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
Last Day = CALCULATE(sum('order'[Qty]), previousday('Date'[Date]))

Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Day))

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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