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.
Hi,
I am working on Power BI Project and have table with Category and Revenue Amount.
I am looking to SUM Distinct Revenue Amount of Same Category ,but not getting correct Syntax
I am looking to Create NEW DAX Measure, I cannot create Separate table in Model, Only Additional DAX Measure need can be added.
When data is See for
Category A : Output should be 10+20=30
Category B: Output Should be 5+15=20
Category C: Output Should be 3
Category D : Output Should be 1
Please assist with DAX Measure
Solved! Go to Solution.
Hi, @sheikhbiuser , you may use this measure
Sum Distinct = SUMX(SUMMARIZE(DATA, DATA[Category], DATA[Revenue]), DATA[Revenue])
btw, it's fairly easy to get the job done in Power Query.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTI0UIrVwWAaYYg6AZmmWFiGEKYzkGmMxnIBSSvFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Category = _t, Revenue = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Revenue", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Category"}, {{"Distinct", each List.Sum(List.Distinct([Revenue]))}})
in
#"Grouped Rows"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi, @sheikhbiuser , you may use this measure
Sum Distinct = SUMX(SUMMARIZE(DATA, DATA[Category], DATA[Revenue]), DATA[Revenue])
btw, it's fairly easy to get the job done in Power Query.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTI0UIrVwWAaYYg6AZmmWFiGEKYzkGmMxnIBSSvFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Category = _t, Revenue = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Revenue", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Category"}, {{"Distinct", each List.Sum(List.Distinct([Revenue]))}})
in
#"Grouped Rows"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
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 |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |