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
PedroAB
Regular Visitor

DAX SummarizeColummns() and AddMissingItens() error

Hi, guys!

 

I think it's a simple error but I couldn't solve it. 

I need to know how many customers purchased two specific products in the month, such as Coke and Pepsi, filtered by Sector.

 

I did it in 3 steps. Fist I did a SUMMARIZECOLLUMN, then GROUPBY and finally COUNTX.

 

When I do it in DAX Studio works fine, but when I put it in a table that contains the Key_Sector column  doesn't.

What am I doing wrong?

 

 

Qualified Purchase = 

VAR Table1 =
ADDCOLUMNS(
SUMMARIZECOLUMNS(
    Clientes[Key_Sector],
    Produtos[Product],
    Clientes[Key_Client],
    KEEPFILTERS( TREATAS( {"COKE","PEPSI"}, Produtos[Product] ))),
    "Qtd", [PDV | Cobertura]
)

VAR Table2 =
FILTER(
	GROUPBY(Table1, [Key_Sector], [Key_Client], "Cob", SUMX(CURRENTGROUP(), [PDV | Cobertura])),
[Cob] = 2 )

RETURN
COUNTX(Table2, [Key_Sector])

 

1 REPLY 1
Anonymous
Not applicable

Hi @PedroAB ,

 

It's hard to check the formula without any data. Please share some sample data so that we could do some test.

 

Best Regards,

Jay

Helpful resources

Announcements
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!

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