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

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

Reply
swrlabhe
Helper I
Helper I

Date Diff between Selected Value from Slicer and A date field

Hi PBI Gurus

I have a scenrio where the date is in date range on Sliders and the table have a data with fields having another date.

The date slicer has date field name <System_Date> while the visual have date filed name <Updated_Date>

Now If I Select <System_Date> range from date slicer say 01-Jun-2024 to 30-Jun-2024 it should show below data 

 

swrlabhe_0-1751572204850.png

No Of Days shold be calculated based upon the End Date select in date slicer - the Updated_Date in table visual.

 

Appreciate your help here

1 ACCEPTED SOLUTION

If you want the slicer to also filter the table then you will need to make a relationship between the date table and the fact table.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
jgeddes
Super User
Super User

A measure like the following will work when the table date is not related to the date from the date table.

Measure = 
var _maxDate = 
MAXX(dateTable, dateTable[Date])
var _diff = 
DATEDIFF(SELECTEDVALUE('Table'[DateFromTable]), _maxDate, DAY)
RETURN
_diff

jgeddes_0-1751574219830.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





This is just calculating No Of Days but it should also filter the table below , so If I select end date as 30-Jun-2024 the date slider is having properties as before so it shoudl show all data before 30-jun-2024

Thanks it worked as expected

If you want the slicer to also filter the table then you will need to make a relationship between the date table and the fact table.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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