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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors