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! Request now

Reply
Lily_DS
Frequent Visitor

how to create new table in power bi depended on Max date from another table

In powerbi I have table42 with 3 columns ( productId , amount , date) i need to creat a new table depends on this table(table42) with filter return only max date for each product and amount so i can calaculate the total amount

below my condation in sql

case when d.Date=(SELECT max(z.Date) FROM table42 zz WHERE d.prdAcctId=zz.prdAcctId)

I tried this but I don't get any result

= #table({"prdAcctId","date", "amount"},{table42[prdAcctId],table42[date],DATEVALUE(MAX('Table42'[DATE]))}

thanks in advance.

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@Lily_DS Seems like you are mixing Power Query and DAX together. Here is a DAX solution. You would create a new table in the Desktop (not Power Query Editor)

Table = SUMMARIZE('Table42',[prdAcctId],"Date",MAX('Table42'[DATE]))


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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

v-chenwuz-msft
Community Support
Community Support

Hi @Lily_DS ,

 

I think you want "Group By" function in power query, please refer this link.

vchenwuzmsft_0-1663059355217.png

https://docs.microsoft.com/en-us/power-query/group-by 

 

Best Regards

Community Support Team _ chenwu zhu

 

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

3 REPLIES 3
v-chenwuz-msft
Community Support
Community Support

Hi @Lily_DS ,

 

I think you want "Group By" function in power query, please refer this link.

vchenwuzmsft_0-1663059355217.png

https://docs.microsoft.com/en-us/power-query/group-by 

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Greg_Deckler
Community Champion
Community Champion

@Lily_DS Seems like you are mixing Power Query and DAX together. Here is a DAX solution. You would create a new table in the Desktop (not Power Query Editor)

Table = SUMMARIZE('Table42',[prdAcctId],"Date",MAX('Table42'[DATE]))


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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

thank you your comment really help me i catch💡 why always getting errors! i'm a beginner, do you have any resource clarify the Power Query and DAX ?

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