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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Deepikasubu
Frequent Visitor

Max of amount on a specific column

Hi,
Below is the data i have:
Table 1:

CodeRV
2017-0014540.3
2017-1140130.85
2017-0014222.3
2017-111012.75
2017-1036F2.74
2017-170002.5
2017-120312.45
2017-111001.27
2017-001401.25
2017-114021.22
2017-170031.22
2017-110420.6

 

Table 2:

LOBNameCode
MEDMAC2017-00140
MEDMAC2017-00142
MEDMAC2017-00145
MEDSWD2017-1036F
Not SpecifiedSWD2017-1036F
COMMRJ2017-11042
COMRTD2017-11100
COMRTD2017-11101
MEDRTD2017-11101
COMRTD2017-11401
MEDRTD2017-11401
COMRTD2017-11402
MEDRTD2017-11402
COMRTD2017-12031
MEDRTD2017-12031
COMRTD2017-17000
MEDRTD2017-17000
MEDRTD2017-17003

 

Table 1 and Table 2 is joined by code with  1 to M relationship having cross filter direction enabled (BOTH).

 

Expected Result:

NameRVMeasure
MRJ0.6 
MAC63.85 
RTD42.2663.85
SWD2.74 

 

In the "Measure" above i need max of the "RV" displayed only for Name="RTD".
can anyone help? i tried so many ways, but ended up with 42.26 itself...

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Measure = 
VAR myTable = SUMMARIZE(ALL(Table2),Table2[Name],"RV",CALCULATE(SUM(Table1[RV])))
VAR theMax = MAXX(myTable,[RV])
RETURN IF(MAX([Name])="RTD",theMax,BLANK())

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

Measure = 
VAR myTable = SUMMARIZE(ALL(Table2),Table2[Name],"RV",CALCULATE(SUM(Table1[RV])))
VAR theMax = MAXX(myTable,[RV])
RETURN IF(MAX([Name])="RTD",theMax,BLANK())

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks it was really helpful

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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