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 table that looks loosely like this:
Project Name | SprintName | SprintDate | Value |
ProjectA | Back-End | 22-Oct | 6 |
ProjectA | Front-End | 21-Oct | 5 |
ProjectA | Front-End | 20-Oct | 2 |
ProjectA | Back-End | 21-Oct | 1 |
ProjectB | Front-End | 22-Oct | 5 |
I want in a metric (to be more specific, it will be defined as a variable amidst a larger equation), a way to sum the Values (column 4) from only the latest (Column 3) of each Sprint Name (Column 2). Within the report that are filtered by Project Names (Column 1).
I've tried filters, and group by's but since the latest date isn't always the same between sprints (one sprint's latest update is on October 22nd, the other is on October 21st), I'm having difficulty coming up with the right dax function.
Anyone have any idea?
Solved! Go to Solution.
I'm replying to myself because I think I solved it doing the following:
In my Table I created a column that checks the latest date:
MaxDate = CALCULATE(MAX('ProjectTable[SprintDate]),FILTER('ProjectTable, ProjectTable[SprintName]=EARLIER(ProjectTable[SprintName])))and then a second column to create a flag
LatestValue = If(ProjectTable[Metric Date] = ProjectTable[MaxDate], 1, 0)Finally the measure itself has the following formula
SUMX( VALUES(ProjectTable[SprintName]), CALCULATE( SUM(Project Table[Value]), FILTER(ProjectTable,ProjectTable[Type] = "TypeA" && ProjectTable[LatestValue] = "1") ))
Sorry, I forgot to Specify something.
There's a 5th column in the table that needs to be included in the filters.
So right now I have the following which doesn't work:
SUMX( VALUES(ProjectTable[SprintName]), CALCULATE(SUM(ProjectTable[Value]), FILTER(ProjectTable[Type] = "typeA" && 'ProjectTable[SprintDate] = MAX ( ProjectTable[SprintDate]))))
And since this will ultimately be just a variable inside a larger metric calculation, I don't want to summarize a new table for it.
I'm replying to myself because I think I solved it doing the following:
In my Table I created a column that checks the latest date:
MaxDate = CALCULATE(MAX('ProjectTable[SprintDate]),FILTER('ProjectTable, ProjectTable[SprintName]=EARLIER(ProjectTable[SprintName])))and then a second column to create a flag
LatestValue = If(ProjectTable[Metric Date] = ProjectTable[MaxDate], 1, 0)Finally the measure itself has the following formula
SUMX( VALUES(ProjectTable[SprintName]), CALCULATE( SUM(Project Table[Value]), FILTER(ProjectTable,ProjectTable[Type] = "TypeA" && ProjectTable[LatestValue] = "1") ))
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 |
---|---|
49 | |
26 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
43 | |
19 | |
18 |