Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I would like to create a scenario where a user chooses a date which is then used to calculate the number of days,weeks and months between the user's chosen date and dates in a table column which are shown in a report.
The parameter should have a default value of today's date.
Would you be able to advise me of the easiest way to do this ?
Many thanks
Scott
Solved! Go to Solution.
Hello @PaisleyPrince,
Can you please try creating a date parameter and use it to dynamically calculate the difference:
Days Difference =
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), DAY)
Weeks Difference =
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), WEEK)
Months Difference =
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), MONTH)
Hope this helps.
Hello @PaisleyPrince,
Can you please try creating a date parameter and use it to dynamically calculate the difference:
Days Difference =
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), DAY)
Weeks Difference =
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), WEEK)
Months Difference =
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), MONTH)
Hope this helps.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |