Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I want to display "currently you are in <Phase 1>, 22 days to go for the event"
- Currently means today's date
- <Phase 1> will be picked from a lookup up below
- countdown wrt to Phase 3 date
Phase | Date | |
Phase 1 | Monday, June 12,2023 | |
Phase 2 | Tuesday, August 1,2023 | |
Phase 3 | Tuesday, October 17, 2023 |
|
Solved! Go to Solution.
Hi @saipawar ,
Thanks for the reply from @PhilipTreacy , like he said, I do not quite understand your needs, I can only do what I can to help you.
Based on the table you provided, I am not sure why today is part of phase 1 and why it is 22 days.
My understanding is this:
First determine the phase you currently belong to based on today is date, then calculate the number of days between today and Phase 3.
If today is date is earlier than Phase 1 then it belongs to Phase 1, if today is date is earlier than Phase 2 then it belongs to Phase 2, if today is date is earlier than Phase 3 then it belongs to Phase 3.
I modified the example data as follows:
Phase |
Date |
Phase 1 |
6/12/2024 |
Phase 2 |
8/1/2024 |
Phase 3 |
10/17/2024 |
First, create a measure to calculate the phase to which the current date belongs:
Current Phase =
VAR TodayDate =
TODAY ()
RETURN
IF (
TodayDate
< CALCULATE (
MAX ( 'Phases'[Date] ),
FILTER ( 'Phases', 'Phases'[Phase] = "Phase 1" )
),
"Phase 1",
IF (
TodayDate
< CALCULATE (
MAX ( 'Phases'[Date] ),
FILTER ( 'Phases', 'Phases'[Phase] = "Phase 2" )
),
"Phase 2",
"Phase 3"
)
)
Next, calculate the date interval between today and the Phase 3 date:
Countdown to Phase 3 =
VAR Phase3Date =
CALCULATE (
MAX ( 'Phases'[Date] ),
FILTER ( 'Phases', 'Phases'[Phase] = "Phase 3" )
)
RETURN
DATEDIFF ( TODAY (), Phase3Date, DAY )
Then, apply dynamic text formatting, which will change dynamically based on today is date:
Dynamic Text =
"Currently, you are in " & [Current Phase] & ", "
& ABS ( [Countdown to Phase 3] ) & " days to go for the event."
Finally, the Dynamic Text is dragged to the card visual object for display, and the page visualization looks like the following:
The pbix file is attached.
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @saipawar ,
Thanks for the reply from @PhilipTreacy , like he said, I do not quite understand your needs, I can only do what I can to help you.
Based on the table you provided, I am not sure why today is part of phase 1 and why it is 22 days.
My understanding is this:
First determine the phase you currently belong to based on today is date, then calculate the number of days between today and Phase 3.
If today is date is earlier than Phase 1 then it belongs to Phase 1, if today is date is earlier than Phase 2 then it belongs to Phase 2, if today is date is earlier than Phase 3 then it belongs to Phase 3.
I modified the example data as follows:
Phase |
Date |
Phase 1 |
6/12/2024 |
Phase 2 |
8/1/2024 |
Phase 3 |
10/17/2024 |
First, create a measure to calculate the phase to which the current date belongs:
Current Phase =
VAR TodayDate =
TODAY ()
RETURN
IF (
TodayDate
< CALCULATE (
MAX ( 'Phases'[Date] ),
FILTER ( 'Phases', 'Phases'[Phase] = "Phase 1" )
),
"Phase 1",
IF (
TodayDate
< CALCULATE (
MAX ( 'Phases'[Date] ),
FILTER ( 'Phases', 'Phases'[Phase] = "Phase 2" )
),
"Phase 2",
"Phase 3"
)
)
Next, calculate the date interval between today and the Phase 3 date:
Countdown to Phase 3 =
VAR Phase3Date =
CALCULATE (
MAX ( 'Phases'[Date] ),
FILTER ( 'Phases', 'Phases'[Phase] = "Phase 3" )
)
RETURN
DATEDIFF ( TODAY (), Phase3Date, DAY )
Then, apply dynamic text formatting, which will change dynamically based on today is date:
Dynamic Text =
"Currently, you are in " & [Current Phase] & ", "
& ABS ( [Countdown to Phase 3] ) & " days to go for the event."
Finally, the Dynamic Text is dragged to the card visual object for display, and the page visualization looks like the following:
The pbix file is attached.
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @saipawar
Your request is too vague.
How do we know what phase has been seelcted?
Where do you want this information displayed? In a card visual?
If the countodwn is wrt to the Phase3 date, and you are in Phase 1, based on your table, there would be more than 22 days to go.
Please provide more information and answers to the above.
Regards
Phil
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
105 | |
88 | |
75 | |
66 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |