Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
So I have a table like that looks like this:
What I want is to create a measure that get me the most recent value for each ID. So when I view the data in a pivottable it give me:
AA 12
BB 20
CC 15
DD 22
Any idea how I can get this done in DAX/powerpivot?
Hi,
Could you tell me please if your problem is solved? You can mark the right answer to help others if it's convenient for you.
Best Regards!
Dale
Hi,
Following @Greg_Deckler's idea, you need to do these steps.
Measure =
CALCULATE (
MIN ( Table1[Value] ),
FILTER ( Table1, Table1[Attribute] = MAX ( Table1[Attribute] ) )
)
If you only have columns 2007, 2008, 2009, 2010, you still can try a calculated column.
LatestValue =
IF (
ISBLANK ( [2010] ),
IF (
ISBLANK ( [2009] ),
IF ( ISBLANK ( [2008] ), IF ( ISBLANK ( [2007] ), BLANK (), [2007] ), [2008] ),
[2009]
),
[2010]
)
Best Regards!
Dale
You are going to want to unpivot your data on import so that you get your table in a format like:
ID, Year, Value
You'll do this in the Query Editor. At that point, your problem is fairly trivial.
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
114 | |
98 | |
96 | |
68 | |
67 |