Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have data that has a value that has two attributes:
so something like this:
the column 'primary' is the column I am trying to derive with DAX. Using Excel, since it is cell-based, it is easy to accomplish using nested INDEX, MATCH, and MAX functions across the rows, but since PowerBI is column-based, I can't replicate. I have the data structured in the first three columns. how do I generate the fourth column, which returns the name of the leader cross-referenced with the building, who has the majority share of people in each building?
Solved! Go to Solution.
Hi @dsalony ,
Please try:
Primary =
var _maxpeople = MAXX(FILTER('Table',[Building]=EARLIER('Table'[Building])),[People])
return MAXX(FILTER('Table',[Building]=EARLIER('Table'[Building])&&[People]=_maxpeople),[Leader])
Output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dsalony ,
Please try:
Primary =
var _maxpeople = MAXX(FILTER('Table',[Building]=EARLIER('Table'[Building])),[People])
return MAXX(FILTER('Table',[Building]=EARLIER('Table'[Building])&&[People]=_maxpeople),[Leader])
Output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thanks, that worked!
Hi,
This calculated column formula works
=LOOKUPVALUE(Data[Leader],Data[People],CALCULATE(MAX(Data[People]),FILTER(Data,Data[Building]=EARLIER(Data[Building]))),Data[Building],Data[Building])
Hope this helps.