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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
AccountNumber | ZipCode | Product | Sales | MaxSales |
101 | 04401 | Chairs | 750 | 1,000 |
102 | 04401 | Chairs | 1,000 | 750 |
103 | 04401 | Chairs | 300 | 1,000 |
104 | 04401 | Chairs | 400 | 1,000 |
Is this possible? I know I can do this as a measure but I'm trying to make it a calculated column to see if this improves the speed by not doing the maximum calculation on the fly.
Solved! Go to Solution.
Hi @Mainer04401 ,
Here are the steps you can follow:
1. Create calculated column.
Column =
var _1 =CALCULATE(MAX('Table'[Sales]),FILTER('Table','Table'[Sales]=MAX('Table'[Sales])))
var _2 =CALCULATE(SUM('Table'[Sales]),FILTER('Table',RANKX('Table','Table'[Sales])=2))
return IF('Table'[Sales]=MAX('Table'[Sales]),_2,_1)
2. Result.
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Mainer04401 ,
Here are the steps you can follow:
1. Create calculated column.
Column =
var _1 =CALCULATE(MAX('Table'[Sales]),FILTER('Table','Table'[Sales]=MAX('Table'[Sales])))
var _2 =CALCULATE(SUM('Table'[Sales]),FILTER('Table',RANKX('Table','Table'[Sales])=2))
return IF('Table'[Sales]=MAX('Table'[Sales]),_2,_1)
2. Result.
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Mainer04401 , Try a measure like
calculate(Max(Table[Sales]), filter(allselected(Table[AccountNumber]) ,Table[AccountNumber] <> max(Table[AccountNumber])))
or
calculate(Max(Table[Sales]), filter(allselected(Table) ,Table[AccountNumber] <> max(Table[AccountNumber])))
@amitchandak Thanks, I've gotten this to work as a measure but I'm trying to make a calculated column so that the calculation occurs during data refresh and not on the fly. Can the current row's value be excluded from the maximum calculation when doing so in a calculated column?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.