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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Sibrulotte
Helper III
Helper III

Calculate with ALL and FILTER on different tables

Hi,

I would like to calculate this:

 

CALCULATE(Sum('Balance'[Market value]), ALL('State'[StateName]),Filter('Balance', 'Balance'[Year]=max('Balance'[Year])))
 
Basically, sum the market value for all states (even when there is a filter) but filter it so that only the max year is taken into account.
 
 
1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
v-xulin-mstf
Community Support
Community Support

Hi @Sibrulotte,

 

Try measure as:

Measure = 
SUMX(VALUES('Table'[Delivery Date]),CALCULATE(Sum('Balance'[Market value]), Filter('Balance', 'Balance'[Year]=MAXX(Balance','Balance'[Year]))))

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

Hi, 

thank you for taking the time to respond!

 

I'm not quite sure what Table [Delivery date] does in the formula, so I can't realy replicate it since I'm not sure how to transpose it.

 

YearStateNameAverage AgeAverage BalanceMarket value
2020NY401005000
2021NY5030015000
2020KY5040010000
2021KY6060020000
2020CA2050100
2021CA30150300
2020FL4050020000
2021FL50150040000
2020TX5012006000
2021TX406001000

 

and the result would be 76300 even if I have FL selected in a slicer

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Sibrulotte,

 

Try measure as:

Measure = 
SUMX(VALUES('State'[StateName]),CALCULATE(Sum('Balance'[Market value]), Filter('Balance', 'Balance'[Year]=MAXX(Balance','Balance'[Year]))))

vxulinmstf_0-1629082500411.png

 

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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