Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
brief001
Helper II
Helper II

Calculate the median, but sum in advance.

brief001_0-1667997312649.png

 

I have the above bleu table. And I want to generate a (yellow) table that shows the median of "Value" by color.
But before calculating the median, "Value" must first be summed to "Color" and "Animal", like the green table above.

 

 

 

To make the example table, below the code of the advanced editor:


let
Bron = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("hdBND4IgGAfw78LZg/iax1LXOtW0m3ONJSKLQWP5/XtoTWBNu/AAvz+vXYdO1S0MMQpQQwdoS/KCNkF98KVoneKFKsV8StYpXejKGdVQscVsC3MYHgSdodSCPicizYUKG9jZQKnVXQ1cUD9R2MSRazKO1LscDq23kjz81dh801kTycz8/nN6ZDX6VWfneFMTV1tK2CwE9FKbSP8mMjdx4ebb4T0L5y43E5cKaoz6/g0=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Color = _t, Animal = _t, Value = _t]),
#"Type gewijzigd" = Table.TransformColumnTypes(Bron,{{"ID", type text}, {"Color", type text}, {"Animal", type text}, {"Value", Int64.Type}})
in
#"Type gewijzigd"

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please try the below DAX formula to create a new table.

 

Jihwan_Kim_0-1668000116463.png

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
brief001
Helper II
Helper II

Hi @Jihwan_Kim thanks for your super quick response. I copied your DAX example, and it works exactly as hoped

Thank you so much for thinking along and providing the right DAX formula!

Jihwan_Kim
Super User
Super User

Hi,

Please try the below DAX formula to create a new table.

 

Jihwan_Kim_0-1668000116463.png

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors