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.
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.
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 |
---|---|
114 | |
99 | |
82 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |