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
Anonymous
Not applicable

Help on aggregation on new table

Hi,

 

I have the following table which I copied from df_Bill_Flexcab and  using the formula:

Table = SUMMARIZE(df_BillHist_Flexcab,df_BillHist_Flexcab[CIDN], df_BillHist_Flexcab[Service_Number])
 
Goal: I need to be able to aggregate the CIDN by the count of service number from the newly created table. Then I will need to group them by if Service Number>=10, ">10 services", if  Service Number<10, "Less than 10 services" and so on. 
 
jdalfonso_2-1627381004062.png

Can you assist me with the formula please? Thank you! 


 

 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description and screenshot , the Table is summarized by original table, so I'd suggest you add ADDCOLUMNS() to your DAX syntax like this:

Table = 
ADDCOLUMNS (
    SUMMARIZE (
        df_BillHist_Flexcab,
        df_BillHist_Flexcab[CIDN],
        df_BillHist_Flexcab[Service_Number]
    ),
    
    "Flag",
        VAR _count =
            CALCULATE (
                DISTINCTCOUNT ( df_BillHist_Flexcab[Service_Number] ),
                ALLEXCEPT ( df_BillHist_Flexcab, df_BillHist_Flexcab[CIDN] )
            ) + 0
        RETURN
            IF ( _count < 10, "Less than 10 services", ">10 services" )
)

The final output is shown below:

ADDCOLUMNS to a summarized table.PNG

 

Best Regards,
Eyelyn Qin
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

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description and screenshot , the Table is summarized by original table, so I'd suggest you add ADDCOLUMNS() to your DAX syntax like this:

Table = 
ADDCOLUMNS (
    SUMMARIZE (
        df_BillHist_Flexcab,
        df_BillHist_Flexcab[CIDN],
        df_BillHist_Flexcab[Service_Number]
    ),
    
    "Flag",
        VAR _count =
            CALCULATE (
                DISTINCTCOUNT ( df_BillHist_Flexcab[Service_Number] ),
                ALLEXCEPT ( df_BillHist_Flexcab, df_BillHist_Flexcab[CIDN] )
            ) + 0
        RETURN
            IF ( _count < 10, "Less than 10 services", ">10 services" )
)

The final output is shown below:

ADDCOLUMNS to a summarized table.PNG

 

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

PaulDBrown
Community Champion
Community Champion

Try:

Count of Service number = CALCULATE(COUNT(table[service number]), ALLEXCEPT(Table, Table [CIDN]))

 

 

and then

Group = SWITCH(TRUE(),
[Count of service number] >= 10, ">10 services",
"Less than 10 services")





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.