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

View all the Fabric Data Days sessions on demand. View schedule

Reply
lennox25
Post Patron
Post Patron

How to total Categories completed per row

Hi, 

Can anyone help? 

 

I need to total the completed categories per row. For example on 31/10/22 There was 5 completed categories (2 blanks). I would like a Total column at the end displaying Total No completed excluding the blanks?

lennox25_0-1685980095306.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lennox25 

You can refer to the following two ways

1.Create a calculated column

Column = var a=SUMMARIZE(FILTER('Table',[Cat A]<>BLANK()),[Date],'Table'[Cat A])
var b=SUMMARIZE(FILTER('Table',[Cat B]<>BLANK()),[Date],'Table'[Cat B])
var c=SUMMARIZE(FILTER('Table',[Cat C]<>BLANK()),[Date],'Table'[Cat C])
var d=SUMMARIZE(FILTER('Table',[Cat D]<>BLANK()),[Date],'Table'[Cat D])
var e=SUMMARIZE(FILTER('Table',[Cat E]<>BLANK()),[Date],'Table'[Cat E])
var f=SUMMARIZE(FILTER('Table',[Cat F]<>BLANK()),[Date],'Table'[Cat F])
var g=SUMMARIZE(FILTER('Table',[Cat G]<>BLANK()),[Date],'Table'[Cat G])
return COUNTROWS(FILTER(UNION(a,b,c,d,e,f,g),[Date]=EARLIER('Table'[Date])))

Output

vxinruzhumsft_0-1686106358798.png

 

2.Unpivot the table first in power query then create a calculated column

Column = COUNTROWS(FILTER('Table (2)',[Date]=EARLIER('Table (2)'[Date])&&[Value]<>BLANK()))

vxinruzhumsft_1-1686106628294.png

 

Best Regards!

Yolo Zhu

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

4 REPLIES 4
Anonymous
Not applicable

Hi @lennox25 

You can refer to the following two ways

1.Create a calculated column

Column = var a=SUMMARIZE(FILTER('Table',[Cat A]<>BLANK()),[Date],'Table'[Cat A])
var b=SUMMARIZE(FILTER('Table',[Cat B]<>BLANK()),[Date],'Table'[Cat B])
var c=SUMMARIZE(FILTER('Table',[Cat C]<>BLANK()),[Date],'Table'[Cat C])
var d=SUMMARIZE(FILTER('Table',[Cat D]<>BLANK()),[Date],'Table'[Cat D])
var e=SUMMARIZE(FILTER('Table',[Cat E]<>BLANK()),[Date],'Table'[Cat E])
var f=SUMMARIZE(FILTER('Table',[Cat F]<>BLANK()),[Date],'Table'[Cat F])
var g=SUMMARIZE(FILTER('Table',[Cat G]<>BLANK()),[Date],'Table'[Cat G])
return COUNTROWS(FILTER(UNION(a,b,c,d,e,f,g),[Date]=EARLIER('Table'[Date])))

Output

vxinruzhumsft_0-1686106358798.png

 

2.Unpivot the table first in power query then create a calculated column

Column = COUNTROWS(FILTER('Table (2)',[Date]=EARLIER('Table (2)'[Date])&&[Value]<>BLANK()))

vxinruzhumsft_1-1686106628294.png

 

Best Regards!

Yolo Zhu

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

 

Hi @Anonymous, This worked perfectly on my sample report but when tried on my actual real data it is incorrect, this is because there is more than one row with the same date.  Can the 1st calculated columun formula be adjusted to allow this? There will never be the same staff number for the same date.

lennox25
Post Patron
Post Patron

Hi @nvprasad  would you be able to advise on the IF formula I could use please? Thank you

nvprasad
Solution Sage
Solution Sage

Hi lennox25,

If you are trying to get this in a new calculated column then If function can get this. The only downside which i could see is if your data is too high (# of rows) then it effects the performance. Also same can be obtained in Power Query Editor using IF logic.

I feel Power Query is the better option compare to the using DAX.

 

Appreciate a Kudos! ‌‌
If this helps and resolves the issue, please mark it as a Solution! ‌‌

Regards,
VN

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

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