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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
smoothbrain
New Member

Multiple COUNTROWS?

Hey team, 

I'm a chimp at a typewriter trying to lean into PowerBI. Not terrifically experience with DAX, but am the desinated 'data' person. 

Is it possible to sum multiple Countrows? An active participant in a program is assined a value of 5, whereas a passive participant is assigned a value of 2? 

CALCULATE
    (COUNTROWS('DataTable'),
    FILTER('DataTable','DataTable'[Status]="Active"
    &&'DataTable'[Program]="Program1"))*5


Then I'm assuming the second half would be something to the effect of: 

CALCULATE
    (COUNTROWS('DataTable'),
    FILTER('DataTable','DataTable'[Status]="Passive"
    &&'DataTable'[Program]="Program1"))*2


Am I able to get a sum of the total? The value assigned depends on the program, and it spans across a couple of programs. 

If anyone could steer in the right direciton, I'd be very appreciative! 

Back to Googling for now! 

2 ACCEPTED SOLUTIONS
aduguid
Super User
Super User

I would create a calculated column in your table. Then all you need to do is SUM the calculated column.

 

NewStatusColumn = 
SWITCH(
    TRUE(),
    'DataTable'[Program] = "Program1" && 'DataTable'[Status] = "Active", 5,
    'DataTable'[Program] = "Program1" && 'DataTable'[Status] = "Passive", 2,
    BLANK()  // Default value if none of the conditions are met
)

 

 

View solution in original post

tharunkumarRTK
Super User
Super User

@smoothbrain 

You can do it in this way.

 

SUMX(DataTable, if( 'DataTable'[Status] = "Passive" && 'DataTable'[Program] = "Program1", 2,  if( 'DataTable'[Status] = "Active" && 'DataTable'[Program] = "Program1", 5)))

 



Need Power BI consultation, hire me on UpWork .


If the post helps please give a thumbs up



If it solves your issue, please accept it as the solution to help the other members find it more quickly.




Tharun



 

View solution in original post

2 REPLIES 2
tharunkumarRTK
Super User
Super User

@smoothbrain 

You can do it in this way.

 

SUMX(DataTable, if( 'DataTable'[Status] = "Passive" && 'DataTable'[Program] = "Program1", 2,  if( 'DataTable'[Status] = "Active" && 'DataTable'[Program] = "Program1", 5)))

 



Need Power BI consultation, hire me on UpWork .


If the post helps please give a thumbs up



If it solves your issue, please accept it as the solution to help the other members find it more quickly.




Tharun



 

aduguid
Super User
Super User

I would create a calculated column in your table. Then all you need to do is SUM the calculated column.

 

NewStatusColumn = 
SWITCH(
    TRUE(),
    'DataTable'[Program] = "Program1" && 'DataTable'[Status] = "Active", 5,
    'DataTable'[Program] = "Program1" && 'DataTable'[Status] = "Passive", 2,
    BLANK()  // Default value if none of the conditions are met
)

 

 

Helpful resources

Announcements
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!

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.