Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I’m working with Power BI to analyze work package (WP) data over time. My dataset includes an initial bulk export of all WPs followed by daily exports that only include WPs with changes. Each record is tied to an Export_Date. I need to be able to:
Current DAX Formula ive used:
KPI - Total WP =
VAR SelectedExportDate =
MAX ( WP_Fact_Qry[Export_Date] ) -- Get the selected export date from the slicer
VAR LatestExportDatePerWP =
SUMMARIZE (
WP_Fact_Qry,
WP_Fact_Qry[WPNO_I],
-- Group by work package
"Latest Export Date",
CALCULATE (
MAX ( WP_Fact_Qry[Export_Date] ),
WP_Fact_Qry[Export_Date] >= SelectedExportDate -- Get the latest export date <= the selected date
)
)
RETURN
CALCULATE (
DISTINCTCOUNT ( WP_Fact_Qry[WPNO_I] ),
-- Count distinct work packages
TREATAS (
LatestExportDatePerWP,
WP_Fact_Qry[WPNO_I],
WP_Fact_Qry[Export_Date]
)
)
The formula works but ignores WPs that haven’t changed on the selected export date. If a WP wasn’t updated on or after the selected date, it’s not being shown, but I need to see the most recent record for every WP at any point in time based on the selected export date.
Any help or suggestions on how to retrieve the latest record for each WP, even if they haven’t changed, based on a Export_Date slicer would be greatly appreciated!
a brief summary of the Table in question:
contains a list of work packages (WPs), with each row representing the state of a work package at a given export date. The WPNO_I field, while representing the work package, is not unique, as a work package may have multiple rows if changes occur in future exports. The table tracks key fields related to the status, dates, and KPIs of each work package at the time of export.
Solved! Go to Solution.
well no solution has been provided however my workaround is to use the same formula and use a date filter with slider type "Below"
Hi @alasharimm,
I'm checking how the things are going on about this issue. Whether the answer helps you?
If there is any problem, please feel free to let us know.
well no solution has been provided however my workaround is to use the same formula and use a date filter with slider type "Below"
Hi @alasharimm
In the 12th line, I think your >= should be <= or the comment doesn't make sense.
WP_Fact_Qry[Export_Date] >= SelectedExportDate -- Get the latest export date <= the selected date
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 |
---|---|
105 | |
99 | |
99 | |
38 | |
37 |
User | Count |
---|---|
157 | |
120 | |
74 | |
72 | |
63 |