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

Calculate maximum amount as per date & map the respective amount as per primary key

 

Hi folks,

 

Need some help on this one!

 

I'm trying to map the amount against name by date preference between two tables.

 

For e.g. tables sale_data & Master_ID is connected on alias/Name (many to one relationship).

I need amount 2100 (as this is the amount aginst latest date) from table sale_data mapped to master_id table.

Moreover, the same should be available as column in data view.

 

Capture.PNG

Please feel free to reach out to me in case any more clarification is required.

 

Regards,

Saurabh Kedia

 

1 ACCEPTED SOLUTION

Hi @saurabh_kedia_

 

You don't want to get the result by creating measures,right? Maybe you may try to use 'Group by' function in Query Editor and then use 'Merge Queries' to get the table as requested.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-cherch-msft
Employee
Employee

Hi @saurabh_kedia_

 

You may add a rank measure first. Then you can get the latest amount as below:

Rank =
RANKX ( ALLEXCEPT ( Sale, Sale[Alias] ), CALCULATE ( MAX ( Sale[date] ) ) )
LatestAmount =
CALCULATE ( SUM ( Sale[amount] ), FILTER ( Sale, [Rank] = 1 ) )

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Cherch,

 

Thanks a lot for your inputs!

 

Actually, I knew this method.

I was to find a way to directly get the desired value.

 

Regards,

Saurabh 

Hi @saurabh_kedia_

 

You don't want to get the result by creating measures,right? Maybe you may try to use 'Group by' function in Query Editor and then use 'Merge Queries' to get the table as requested.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Cherch,

 

Thanks for you inputs.

 

Regards,

Saurabh

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.