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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
DouweMeer
Impactful Individual
Impactful Individual

Query that doesn't work

It's probably just me... but my query isn't working. It tell me that 'G_EF.mximpl' is invalid.

 

Select
G.line_item_id
, G.price
, G_EF.mximpl
FROM
mn_price_master_li G
inner join
(
SELECT
max ( G_ED.date_impl ) as "mximpl"
, max ( G_ED.eff_start_date ) as "mxeff"
, G_ED.line_item_id as "Id"
FROM
mn_price_master_li G_ED
WHERE
G_ED.line_item_id = '6314925' OR G_ED.line_item_id = '908200'
GROUP BY
G_ED.line_item_id
) G_EF
ON
G.line_item_id = G_EF.id
and G.date_impl = G_EF.mximpl
and G.eff_start_date = G_EF.mxeff

 

But when I do the following, it does return a table with 3 columns as specified with the select statement in the from part...

SELECT

G_EF.*

FROM

(
SELECT
max ( G_ED.date_impl ) as "mximpl"
, max ( G_ED.eff_start_date ) as "mxeff"
, G_ED.line_item_id as "Id"
FROM
mn_price_master_li G_ED
WHERE
G_ED.line_item_id = '6314925' OR G_ED.line_item_id = '908200'
GROUP BY
G_ED.line_item_id
) G_EF

 

1 ACCEPTED SOLUTION

So, I've found the problem.  

["mximpl"] is not matching with [G_EF.mximpl], it is supposed to be [G_EF."mximpl"] to make it work. 

Silly flaw :). 

 

View solution in original post

5 REPLIES 5
danextian
Super User
Super User

Care to post a screenshot?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
DouweMeer
Impactful Individual
Impactful Individual

Small:

Small query with only G_EFSmall query with only G_EF

Result of small:

Result of small query with only G_EFResult of small query with only G_EF

Attempt on longer one

Long:

Larger query merging G_EF with G.Larger query merging G_EF with G.

Hi @DouweMeer ,

 

Please run the SQL command in your database firstly to check if it will return the correct result. And please check if there is any special character in the G_EF.maxeff column.

 

 

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

So, I've found the problem.  

["mximpl"] is not matching with [G_EF.mximpl], it is supposed to be [G_EF."mximpl"] to make it work. 

Silly flaw :). 

 

Anonymous
Not applicable

Are you sure you posted this question in the right forum?

This looks like SQL and not PowerQuery to me ...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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