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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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