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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

need row count and sum combination

Hi

i have below rows need last column (row_count) as result that is

if system is a or b i need to do row count based on type if system is c i need to add rowcnt 

can any one help me in this

system   type    rowid      rowcnt        row_count
a              x           11                                22
a              y           22                                32
b              x           13                                22
b              y           32                                32
c              x            111            20              22
c               y            212           10              32

c               y            212           20              32

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Check the formula.

Column = IF('Table'[system]="a"||'Table'[system]="b",CALCULATE(MAX('Table'[rowid]),FILTER(ALLEXCEPT('Table','Table'[type]),'Table'[system]="a"||'Table'[system]="b")),IF('Table'[system]="c",CALCULATE(MAX('Table'[rowid]),ALLEXCEPT('Table','Table'[type])))+'Table'[rowcnt])

Result would be shown as below.

13.PNG 

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

Check the formula.

Column = IF('Table'[system]="a"||'Table'[system]="b",CALCULATE(MAX('Table'[rowid]),FILTER(ALLEXCEPT('Table','Table'[type]),'Table'[system]="a"||'Table'[system]="b")),IF('Table'[system]="c",CALCULATE(MAX('Table'[rowid]),ALLEXCEPT('Table','Table'[type])))+'Table'[rowcnt])

Result would be shown as below.

13.PNG 

 

Best Regards,

Jay

Anonymous
Not applicable

Either something like the above or add some columns on or detail records

typeXcount: IF (system = a or system = b) and type= x then 1 else 0 

typeYcount: IF (system = a or system = b) and type = y then 1 else 0

typeCcount: IF (system = c) then 1 else 0)

 

In your visual you can then just sum the columns

amitchandak
Super User
Super User

@Anonymous , logic is not clear with the data you have shown.

 It seem like this measure

calculate(counrows(Table), allexcept(Table, Table[Type]))

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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
Top Kudoed Authors