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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

August Carousel

Fabric Community Update - August 2024

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