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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jcastr02
Post Prodigy
Post Prodigy

Merge Queries - Bring Latest Value only

I am trying to merge queries - brining in the tempoary support table into the Store List.  I am looking to only get the Latest Support Date vs brining all items over.  SEe below , I'd only bring over 2 values.  Any ideas how I can achieve this?  Thank you.

Temporary Support  Store List
Store #Support Start Date Store #Support Start Date
111879/18/2023 111879/18/2023
111879/11/2023 5012/8/2023
111879/5/2023   
111878/28/2023   
111872/15/2023   
111878/24/2023   
501/1/2023   
5012/1/2023   
5012/8/2023   
502/1/2023   
2 ACCEPTED SOLUTIONS

You should just be able to create a max measure. Last Date = MAX( 'Temporary Support'[Support Start Date] ).  Then in your visual pull in Store # and this measure.

View solution in original post

@jcastr02 

Find the report link - https://drive.google.com/file/d/1gSyTaN9qLUmzYMwul37Z4FSxmsqLLr67/view?usp=sharing




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





View solution in original post

9 REPLIES 9
PijushRoy
Super User
Super User

Hi @jcastr02 

Create a Black Table in Power Query
Open Advance Editor
Paste below code

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bczBDQAgCEPRXTiTYFEjzmLcfw25EZXry2/XIgA2iGkKTLRopc2XItP+o6+TAxXkbQvtxQmCVzQjeyiifQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Store #" = _t, #"Support Start Date" = _t]),
    #"Changed Type with Locale" = Table.TransformColumnTypes(Source, {{"Support Start Date", type date}}, "en-US"),
    #"Grouped Rows" = Table.Group(#"Changed Type with Locale", {"Store #"}, {{"Count", each List.Max([Support Start Date]), type nullable date}})
in
    #"Grouped Rows"

 

If solved your requirement, please mark this answer as SOLUTION.
If this comment helps you, appreciate your KUDOS




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





CoreyP
Solution Sage
Solution Sage

Is there a requirement these tables actually be merged in Power Query? Or are you able to accomplish this with DAX measures? 

@CoreyP it can be a DAX, yes.

You should just be able to create a max measure. Last Date = MAX( 'Temporary Support'[Support Start Date] ).  Then in your visual pull in Store # and this measure.

@CoreyP  Sorry I tried the above measure - but since I'm using the Store list to merge into and there should only be 1 record for each in that list and in the temporary support the store # may be multiple, when I add the measure to the table visual, it creates duplicate rows for numerous stores.

Hi @jcastr02 

Did you try POwer Query step I shared earlier? Is it solve your requirement? Or you are looking for DAX?




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





@PijushRoy Thank you - would you be able to share a sample Pbix file, please?

@jcastr02 

Find the report link - https://drive.google.com/file/d/1gSyTaN9qLUmzYMwul37Z4FSxmsqLLr67/view?usp=sharing




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





This worked Thank you!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors