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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
samnaw
Resolver I
Resolver I

MAX not giving right result

Hello:

 

I have a column in my table called FY. It only has 2020 and 2021. So MAX should result in 2021 and MAX -1 2020. Very Simple. 

 

But when I try to do MAX its gives me the following result:

 

Its giving me the total number of rows: 6053315966

 

 

error.PNG

 

 

I know for sure my data is correct:

 

error2.PNG

 

This is a problem because when I:

 

This works

 

CY_Sales = CALCULATE (
SUM ( VW_DASHBOARD_SALES[Sales]),
FILTER ( 'VW_DASHBOARD_SALES','VW_DASHBOARD_SALES'[FY] = 2021),
FILTER ( 'VW_DASHBOARD_SALES', 'VW_DASHBOARD_SALES'[loyalty_flag] = "CARD" ) )
 
But this doesnt
 
CY_Sales = CALCULATE (
SUM ( VW_DASHBOARD_SALES[Sales]),
FILTER ( 'VW_DASHBOARD_SALES','VW_DASHBOARD_SALES'[FY] = MAX('VW_DASHBOARD_SALES'[FY]) ,
FILTER ( 'VW_DASHBOARD_SALES', 'VW_DASHBOARD_SALES'[loyalty_flag] = "CARD" ) )

 

 
 

 

 

1 REPLY 1
amitchandak
Super User
Super User

@samnaw , it should have worked, unless you have used the wrong table or column. Difficult to tell without looking at data. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors