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

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

Reply
avalos
Frequent Visitor

Display a number in a column, but do not sum it

I was wondering if there is any way to have a SUM column, but limit wich values are added.

This would be a simplified example of what I want to achieve: 

Original data

UnitBranchDate
XYZ1Branch 22019/6/1
XYZ2Headquarters2019/6/2
XYZ3Branch 12019/6/3
XYZ4Branch 12019/6/4
XYZ5Branch 32019/6/5
XYZ6Branch 32019/6/6
XYZ7Branch 12019/6/7
XYZ8Branch 32019/6/8
XYZ9Branch 22019/6/9
XYZ10Branch 12019/6/10
XYZ11Branch 32019/6/11
XYZ12Headquarters2019/6/12
XYZ13Branch 22019/6/13
XYZ14Branch 32019/6/14
XYZ15Branch 32019/6/15

 

Table in Power BI

 Units
 June
Branch 14
Branch 23
Branch 36
Headquarters2
 13

 

In the table above, the total is calculated as SUM(B3,B4,B5), leaving the 2 units of "Headquarters" out of the result, but still shown. 

My current formula in Power BI is: Units= if([Unit]<>"",1,0), which would give a total of 15

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @avalos 

 

try this MEASURE

Measure =
IF (
    HASONEFILTER ( Table1[Branch] ),
    COUNT ( Table1[Unit] ),
    SUMX (
        FILTER ( Table1, Table1[Branch] <> "Headquarters" ),
        CALCULATE ( COUNT ( Table1[Unit] ) )
    )
)

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

Hi @avalos 

 

try this MEASURE

Measure =
IF (
    HASONEFILTER ( Table1[Branch] ),
    COUNT ( Table1[Unit] ),
    SUMX (
        FILTER ( Table1, Table1[Branch] <> "Headquarters" ),
        CALCULATE ( COUNT ( Table1[Unit] ) )
    )
)

@Zubair_Muhammad Thanks a lot! It worked perfectly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.