Reputation: 45
I am trying to have measure that can find the latest value of specific attribute. Not sure how to ask other than show the source data
I have tried the following measures but I can't figure out how to extract Value for the Last Period over Owner and Attr. correctly. I have tried MAX, and MAXX but LastPer are not grouping over the Owner and Attr
LastPer = MAX(xxx[Period])
LastVal = CALCULATE(SUM(xxx[Value]), FILTER(xxx, xxx[Period] = xxx[LastPer]))
Giuven this table has > 33 million rows, and I need 10 specific items
last_a = CALCULATE([LastVal], xxx[Attr] = "a")
last_b = CALCULATE([LastVal], xxx[Attr] = "b")
last_c = CALCULATE([LastVal], xxx[Attr] = "c")
I am open to DAX Filtered table as opposed a measure for speed.
Sometimes I wish I can use plain jane SQL in Power BI. Help please
Upvotes: 1
Views: 522
Reputation: 89444
Try something like:
lv = LASTNONBLANKVALUE('Table'[Period],max('Table'[Value]))
Upvotes: 1