Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have found multiple dax masures where MAX() is used with Text column, but none of the found solution explained how exactly does it work.
For example I was looking for measure that would return name of the month that had the highest sales value during respective year.
I implemented this measure into my .pbix (fount this on community):
Best month = calculate(Max('Date'[MonthName]) ,TOPN(1,all('Date'[MonthName]),calculate([SalesUnits] )), values('Date'[MonthName]))
Solved! Go to Solution.
MAX on a text value uses alphabetical order to return a scalar value.
In the measure shown, it's not "really" doing anything, TOPN is returning a table with 1 value - just preventing a syntax error due to measures requiring an aggregation.
If there were 2 months with the same SalesUnits, it would give you the later month in the alphabet eg, sep ahead of feb
MAX on a text value uses alphabetical order to return a scalar value.
In the measure shown, it's not "really" doing anything, TOPN is returning a table with 1 value - just preventing a syntax error due to measures requiring an aggregation.
If there were 2 months with the same SalesUnits, it would give you the later month in the alphabet eg, sep ahead of feb
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |