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.
I have a series of KPIs that I display in a table side by side for each location within the business.
I want to add the last week performance of each KPI to the table along side the current week. However using DATEADD doesn't appear to change the output.
I'm using a page level filter to slice the data to the last 7 days in the table.
As you can see below the output of [LW KPI 1] is the same as the measure it directly references. The DAX in use is:
LW KPI 1 % Jobs Completed on Time = CALCULATE([KPI 1 % Jobs Completed on Time], DATEADD(Jobs[Date Range
Jobs].[Date], -7, DAY))
Any idea why the DATEADD filter is being ignored?
Solved! Go to Solution.
@Anonymous,
It might be caused by date hierarchy. Try to remove .[Date] from the formula above.
@Anonymous,
It might be caused by date hierarchy. Try to remove .[Date] from the formula above.
Sorry I did reply to this, but it doesn't appear to have posted.
Removing .[date] hierarchy introduces a duplicate values error for DATEADD.
So I wrote the following, using the VALUES function to give me a distinct list of dates for each DATEADD function, but get the same duplicates error.
Any ideas?
KPI Score Last Week = var Dates = VALUES(Reports[Date Range]) var KPI1LW = CALCULATE([KPI 1 %], DATEADD(Dates,-7, DAY)) var KPI2LW = CALCULATE([KPI 2 %], DATEADD(Dates, -7, DAY)) var KPI3LW = CALCULATE([KPI 3 %],DATEADD(Dates, -7, DAY)) var KPI4LW = CALCULATE([KPI 4 %],DATEADD(Dates, -7, DAY)) VAR KPI1Score = IF(KPI1LW > [KPI 1 Target], 1, 0) VAR KPI2Score = IF(KPI2LW > [KPI 2 Target], 1, 0) VAR KPI3Score = IF(KPI3LW > [KPI 3 Target], 1, 0) VAR KPI4Score = IF(KPI4LW > [KPI 4 Target], 1, 0) RETURN KPI1Score + KPI2Score + KPI3Score + KPI4Score
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 |
---|---|
113 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |