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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
WulffJoergen
Helper I
Helper I

Total Sum based on max value from another table calculates correctly row by row but overall sum is

Hi Community,

My model has different versions of the budget, and version number can vary based on project and department.
And I desperately needs help to solve the problem.

Regards Jørgen

The code below gives me the correct figure for each project but the Total Row is doing the calculation on the latest version for all projects which happens due to the Bolded text. 
 

Total FTE Latest Budget =
VAR LatestBudget = MAX(ftelines[fte_budget_version])
RETURN
CALCULATE([Total FTE],Filter(ftelines, ftelines[fte_budget_version]=LatestBudget))
 

On you tube I found a video from Goodly using MAXX  but it does not work for me - maybe due to only using 1 table.

 and in DAX Studio I tried below but received the result below the code:
EVALUATE
VAR LatestBudget = MAX(ftelines[fte_budget_version])
VAR LatestFTE = CALCULATE([Total FTE],Filter(ftelines, ftelines[fte_budget_version]=LatestBudget))
Return
ADDCOLUMNS(
    SUMMARIZE(ftelines,Projekt[code],ftelines[trial]),
    "MAXFTE",LatestFTE)

 

WulffJoergen_0-1679406751362.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

4 REPLIES 4
WulffJoergen
Helper I
Helper I

Hi Amitchandak
Thank you for sending the links. It looks like the problem I have, so I will look into it directly.
Regards 
Jørgen

amitchandak
Super User
Super User

@WulffJoergen , Try approch like

Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

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

Hi, 
A little bit of reengeneering and then it worked like a charm 😊
An Idea for an extra blog for you could be the same solution but with multiple filters included (like budget and project).
Regards 
Jørgen

I tried to replicate your data, and when I make the same table I Succeed. When I take my own data and rename and only keeps the columns as you have them, it does not work. Any ideas?

WulffJoergen_0-1679423853269.png

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.