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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
NilR
Post Patron
Post Patron

Wrong Total FOR Addcolumns(Summarize())

I have two measures, but the second one returns wrong total. I added AddColumns to optimize the query. Any suggestions would be great. Thanks!

 

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

Hi @NilR ,

 

I have a little trick to help you see the current tables created by summarize.

 

test =
VAR _s =
    SUMMARIZE (
        'table',
        [column1],
        [column2],
        "newcolumn1", [measure1],
        "newcolumn2", [measure2]
    )
RETURN
    CONCATENATEX (
        _s,
        [column1] & " " & [column2] & " " & [newcolumn1] & " " & [newcolumn2],
        "
"// here please enter "alt+enter" as <delimiter> 
    )

 

If you need more help, please share your pbix without sensitive data.

 

 

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.

amitchandak
Super User
Super User

@NilR , move filter inside the measure and check

 

CALCULATETABLE(
ADDCOLUMNS(SUMMARIZE('PHA', '0PHA'[CNSR_INDV_ID]),
"_BIOM", 0,
"_PHA",0,
"_CTC",CALCULATE(SUMX(values('0630 BIOMPHA'[ENRL_DATE]),MAX('PHA'[CTC]),
FILTER('PHA',([ENRL_DATE]>= Min_Date && [ENRL_DATE]<= Max_Date) && [GP_NB]=_gpnb
&& [CTC] >0))) ) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

😫😭It's still not working 😞 Thank you so much! any other recommendation?

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.