Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have two dates:
policy start date: 1/1/2023
policy end date: 1/20/2023
Duration: 20 days
todays date: 1/10/2023 (this date will change daily)
For policy start and end dates 1/1/2023 - 1/20/2023 (20 Days). If looking ar report on 1/10/2023, the duration of the policy 1/1/2023 - 1/10/2023 (10 days) is at 50%.
If looking at the report on 1/11/2023, the duration will be 1/1/2023 - 1/11/2023 (11 days), which will be 55%.
So this number will change every day depending on when you look at the report.
I want the duration column to be shown in percentage. How would I write this?
Thanks,
Solved! Go to Solution.
Hi @Anonymous ,
Please try below steps:
1. create a measure with below dax formula
Measure =
VAR start_date =
DATE ( 2023, 1, 1 )
VAR end_date =
DATE ( 2023, 1, 20 )
VAR cur_date =
TODAY ()
VAR _diff1 =
DATEDIFF ( start_date, end_date, DAY )
VAR _diff2 =
DATEDIFF ( start_date, cur_date, DAY )
RETURN
DIVIDE ( _diff2, _diff1 )
2. add a crad visual with this measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please try below steps:
1. create a measure with below dax formula
Measure =
VAR start_date =
DATE ( 2023, 1, 1 )
VAR end_date =
DATE ( 2023, 1, 20 )
VAR cur_date =
TODAY ()
VAR _diff1 =
DATEDIFF ( start_date, end_date, DAY )
VAR _diff2 =
DATEDIFF ( start_date, cur_date, DAY )
RETURN
DIVIDE ( _diff2, _diff1 )
2. add a crad visual with this measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey thanks for the reply. What if today's date (cur_date) is coming from a date filter. Is there a way to dynamically change that as the user chnages the date filter?
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
106 | |
99 | |
98 | |
38 | |
37 |
User | Count |
---|---|
158 | |
124 | |
75 | |
74 | |
63 |