Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I need to count something as having occurred only if it was done no longer than 1 year ago. For example, task A is recorded in an Excel file. Multiple departments use the file to record completion of task A, which has to be done at least once a year by each team. I need to count task A as having occurred for each team only if the team has not gone more than 1 year since they last performed the task. See example data below. I would count teams West, North and South as complete (they have done the task within 1 year of today (May 13 2024) and would NOT count team East as they have gone more than 1 year since last performing the task. How can I accomplish this in a Power BI report?
Team | Date Completed |
East | 10/5/2022 |
West | 1/7/2023 |
North | 2/3/2023 |
South | 5/6/2023 |
West | 12/31/2023 |
North | 1/2/2024 |
South | 4/1/2024 |
Solved! Go to Solution.
@AmandaCarriveau can you please try the following instead
Measure =
VAR _count =
IF (
CONVERT (
TODAY ()
- CALCULATE (
MAX ( 'Table 1'[Date Completed] ),
ALL ( 'Table 1'[Date Completed] ),
VALUES ( 'Table 1'[Team] )
),
DOUBLE
) <= 365,
"Completed",
"Not Completed"
)
RETURN
_count
I ended up creating a calculated column to flag if each data is within the past 52 weeks, but thanks for the help!
This is giving "Completed" for everything, even teams where I can see in the raw data they are not complete
Sorry, it is not giving completed for everything, but it is giving completed when it shouldn't. For example, I have an entry for a team that last performed the task 8/10/2022 and it is saying completed
@AmandaCarriveau can you please try the following instead
Measure =
VAR _count =
IF (
CONVERT (
TODAY ()
- CALCULATE (
MAX ( 'Table 1'[Date Completed] ),
ALL ( 'Table 1'[Date Completed] ),
VALUES ( 'Table 1'[Team] )
),
DOUBLE
) <= 365,
"Completed",
"Not Completed"
)
RETURN
_count
I ended up creating a calculated column to flag if each data is within the past 52 weeks, but thanks for the help!
Hi, @AmandaCarriveau
Glad to hear you solved the problem yourself!
If you can, please share your solution, which will be beneficial for future users to read this post
Best Regards
Yongkang Hua
.
@AmandaCarriveau you can write a measure like this
Measure =
IF (
NOT (
ISBLANK (
CALCULATE (
MAX ( 'Table 1'[Team] ),
FILTER (
VALUES ( 'Table 1'[Team] ),
'Table 1'[Team]
IN SUMMARIZE (
FILTER ( ALL ( 'Table 1' ), 'Table 1'[Date Completed] <= TODAY () - 365 ),
'Table 1'[Team]
)
)
)
)
),
"Completed",
"Not Completed"
)
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
90 | |
81 | |
65 | |
65 | |
60 |
User | Count |
---|---|
170 | |
114 | |
102 | |
73 | |
69 |