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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
BhagatRansi
Frequent Visitor

MaxDate per Value

Hi everyone,

 

I am bit in a challenge. I am receiving a table where measures a different frequencies. Some are delivered on a monthly base and some on random dates. The client like to see the most current value with the according date as an informtional attribute with it.

 

Following an example of the data structure:

 

DateOrganisationValue AValue BValue CValue D
01.01.2021

West

50205060
01.02.2021

West

30 5060
01.03.2021

West

30505060
01.04.2021

West

30 5060

 

Result:

 

For Value A,C & D the MaxDate is 01.04.2021 with the Value A=30; C=50 & D=60

 

For Value B the MaxDate is 01.03.2021 with the Value B=50

 

How can I create a measure showing me exact these values and also map the accoring attributes like Date and Organisation to it?

 

Looking forward to hear from you

 

Thanks in advance for any idea

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@BhagatRansi 

1. select date and orgnization column and unpivot other columns in PQ

1.png

2. create two measures

maxdate = MAX('Table'[Date])

Measure = MAXX(FILTER('Table','Table'[Attribute]=max('Table'[Attribute])&&'Table'[Date]=max('Table'[Date])),'Table'[Value])

2.PNG

 please see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

@BhagatRansi 

1. select date and orgnization column and unpivot other columns in PQ

1.png

2. create two measures

maxdate = MAX('Table'[Date])

Measure = MAXX(FILTER('Table','Table'[Attribute]=max('Table'[Attribute])&&'Table'[Date]=max('Table'[Date])),'Table'[Value])

2.PNG

 please see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi Ryan_mayu,

 

I still need your support the solution works so far but now I am facing the issue that when summarizing the values I am getting the Max Value of the analyzed dimension.

See in your example Value D = 60 and the Total result is also 60.

 

Is there a way to sum or to calculate the average of the values? In our case Total =47,5

 

@BhagatRansi 

you can create another measure

Measure 2 = AVERAGEX(VALUES('Table'[Attribute]),[Measure])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks a lot just figured it out last night 😅

Step by step I am getting into it

selimovd
Super User
Super User

Hey @BhagatRansi ,

 

I guess you need anyway a new measure for each Value.

The following should work:

Last Value A = CALCULATE( SUM( myTable[Value A], myTable[Date] = MAX( myTable[Date] ) )

 

Let me know if that works for you.

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Thanks for your reply this solution does not work as MAX cannot be used as filter expression in the Calculate formula

 

BhagatRansi_0-1617895115834.png

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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