cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-Column Aggregations (MC Aggregations)

Super User
1434 Views
Super User
Super User

Multi-Column Aggregations (MC Aggregations)

 

"I like big aggregations and I cannot lie

You other PBI'ers can't deny"

 

The attached PBIX file contains a slew of aggregations that span multiple columns All standard quick aggregations are included, namely:

  • Max
  • Min
  • Sum
  • Average
  • Count
  • Count (Distinct)
  • Variance
  • Standard Deviation
  • Median

 

This techinque can be employed with as many columns as required although I use 4 in the examples. Below is the "MC Max" measure for reference. The rest are a variation on this theme:

 

 

MC Max = 
VAR tmpCol1 = SELECTCOLUMNS(Data,"Column",[Value1])
VAR tmpCol2 = SELECTCOLUMNS(Data,"Column",[Value2])
VAR tmpCol3 = SELECTCOLUMNS(Data,"Column",[Value3])
VAR tmpCol4 = SELECTCOLUMNS(Data,"Column",[Value4])
VAR tmpTable = UNION(UNION(UNION(tmpCol1,tmpCol2),tmpCol3),tmpCol4)
VAR tmpValue = MAXX(tmpTable,[Column])
RETURN tmpValue

 

 

 

 

 


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


sensei Regular Visitor
Regular Visitor

Re: Multi-Column Aggregations (MC Aggregations)

Points for creativity!