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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Sum of max values filtered by year. Help

Hello everyone. 

 

I have a table like this

 

 

DateCountryValue
25/12/2017Poland10
26/12/2017Brazil5
27/12/2017Germany15
28/12/2017Poland11
29/12/2017Poland10
30/12/2017Poland12
31/12/2017Canada14
01/01/2018Germany16
02/01/2018Poland13
03/01/2018Germany15
04/01/2018Brazil6
05/01/2018Canada15
06/01/2018Poland14
07/01/2018Brazil7

 

I'm trying to make a report that shows the sum of the max values of each country filtered by year. So for 2017 it would be 46 and for 2018 it would be 52.

 

I'm really struggling with this, would appreciate some help.

 

Thanks in advance

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Anonymous

 

First of all, in order to easily filter by Year, add a Calendar table with a Year column related to your data table, or a Year column in your data table.

 

Then create a measure like this (replace Data with your actual table name):

Sum of Country Max Values =
SUMX ( VALUES ( Data[Country] ), CALCULATE ( MAX ( Data[Value] ) ) )

Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

You may refer to my solution in this file.

 

Hope this helps.

 

Untitled.png


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

Hi @Anonymous

 

First of all, in order to easily filter by Year, add a Calendar table with a Year column related to your data table, or a Year column in your data table.

 

Then create a measure like this (replace Data with your actual table name):

Sum of Country Max Values =
SUMX ( VALUES ( Data[Country] ), CALCULATE ( MAX ( Data[Value] ) ) )

Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn
Anonymous
Not applicable

Hello @OwenAuger. Thank you so much for the response, it really did it! I have a question though. Why when I did the relation between the date table and my data table, the date from my data table can no longer use the "Date Hierarchy"?

 

I am filtering the date using "Between Dates" but I was wondering why I couldn't use the Date Hierarchy anymore

 

Thanks again for the help

That's good news 🙂

 

When you relate a date column from you data table to a date table, you should apply any filters on the date table rather than the data table.

 

It looks like the hierarchy on the data table date column which previously existed (which is really a behind-the-scenes date table) is automatically disabled when you create a relationship like this.

 

However, a date hierarchy is available on the date table, as long as you don't use the Mark as Date Table function.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn
Anonymous
Not applicable

I see what's happening. Thanks again @OwenAuger I really appreciate it.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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 Solution Authors