Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, when use direct query in powerbi, for example table sales relationed by id_prod with Product
if we want sum of sales of product A, as filter in powerbi,
DirectQuery generate a join slq innecesary
```
select sum("saldo_cuenta") as "C1"
from
(
select "OTBL"."saldo_cuenta"
from "mupibi.saldos"."SALES" as "OTBL"
left outer join "mupi.MUPI"."PRODUCT" as "ITBL" on ("OTBL"."ID_PROD" = "ITBL"."ID_PROD")
where "DESCRIP_PROD" = 'PRODUCT A'
) as "ITBL"
```
Hi @dacopan
Does the query above run and send to SQL database when you create a measure/column or add a column into visual with "sum" aggeration?
What's your problem and final requirement?
Best Regards
Maggie
Hello @v-juanli-msft , sorry but my redaction
Hi @dacopan
Generally, when we need to show sum of product x, we would create a relationship between two tables, then add [product name] or [product id] onto a visual, then add [sales] onto the visual and select "sum" as an aggregation.
From your query, if you select a product from the table like selecting "product a" from slicer "product", it would generate a sql statement like "where "DESCRIP_PROD" = 'PRODUCT A'".
It is neccessary to filter and return the certain data.
Best Reagrds
Maggie
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.