Forum Discussion
gco
6 years agoResolver II
Adding MAXX
Hi there, I have a table that contains Accounts, OpenDate, and NumberofProds. NumberofProds is calculated as MAXX(tablename, tablename[OpenProds]. And i am now trying to get a sum of all Number...
- 6 years ago
Hi gco,
You could try below measure to see whether it work or not
My sample data is like below
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUTIyMLTUN9Q3BDJNlWJ1MASNUAWNwIKG2ASNUQWNwYJm2AQh2pOw2Z6EzfYkbLajCaJpR7Y9CcP2WAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [id = _t, date = _t, amount = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"id", type text}, {"date", type date}, {"amount", Int64.Type}}) in #"Changed Type"Measure 4 = IF ( HASONEVALUE ( 'Table (3)'[id] ), MAXX ( 'Table (3)', 'Table (3)'[amount] ), SUMX ( SUMMARIZE ( 'Table (3)', 'Table (3)'[id], 'Table (3)'[date], "max", MAX ( 'Table (3)'[amount] ) ), [max] ) )Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dax
6 years agoCommunity Support
Hi gco,
You could try below measure to see whether it work or not
My sample data is like below
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUTIyMLTUN9Q3BDJNlWJ1MASNUAWNwIKG2ASNUQWNwYJm2AQh2pOw2Z6EzfYkbLajCaJpR7Y9CcP2WAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [id = _t, date = _t, amount = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"id", type text}, {"date", type date}, {"amount", Int64.Type}})
in
#"Changed Type"Measure 4 =
IF (
HASONEVALUE ( 'Table (3)'[id] ),
MAXX ( 'Table (3)', 'Table (3)'[amount] ),
SUMX (
SUMMARIZE (
'Table (3)',
'Table (3)'[id],
'Table (3)'[date],
"max", MAX ( 'Table (3)'[amount] )
),
[max]
)
)
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.