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
WEARLE
Frequent Visitor

New to power bi - subtract one column number from count of text occurrence

Hi hope you can help - I know the title doesnt make much sense but can I try and explain?
I have one column in my table in power bi that contains  76 diffferent words and i have set up meaures to count instances of those words to add to reports. So for example

 

 

TaskAllNot DueDue
Blabla110
Blabla110
Blabla110
Blabla110
Blabla101
Blabla101
Blabla101
Blabla101
Blabla101

 

So i made a measure which counts the instances of blabla

Blabla = CALCULATE ( COUNTROWS ( Tablename), Tablename [Task] = "Blabla" )
 
Which is fine but I need to only count BlaBlas where the taskm is due and ignore the ones where it is not due? Am i able to add anything to the formula that would take column "not due" from column "All"
 
Any help would be great i am v new to this!

Thanks
1 ACCEPTED SOLUTION

You can try the following:

 

CALCULATE ( COUNTROWS ( Tablename), Tablename [Task] = "Blabla" &&Tablename [ALL]>0))

View solution in original post

7 REPLIES 7
WEARLE
Frequent Visitor

Thanks @gadielsolis and @Dangar332 for your help greatly appreciated 🙂

 

WEARLE
Frequent Visitor

thanks @gadielsolis and @Dangar332 !

Just so I can try and make sure its right then and give a bit more detail the table fully looks like below and I only want to count blablas in the all column as the data I have been provided wiht seems to court this all up already - are the measures you posted still right? Sorry should have gone into more details first time 😞 basically the all column doesnt court anything that is Not Yet Due - thankyou in advance!!!

 

Descpription    All   Not Due    Due    Over-due    Escalated  
Blabla01000
Blabla11000
Blabla05000
Blabla50005
Blabla510550

hi, @WEARLE 

can you elaborate your requirnment from above table

You can try the following:

 

CALCULATE ( COUNTROWS ( Tablename), Tablename [Task] = "Blabla" &&Tablename [ALL]>0))

Hi - me again sorry - so this works but it only counts the task as 1 even if the value in ALL is higher. So I need it count as 3 tasks if the value in ALL is 3. For example:

 

Task  All  Not Due  Due  Overdue  Escalated  
Bla30300
Bla03000
Bla20200
Bla50005
Bla15100

 

So it seems that 

CALCULATE ( COUNTROWS ( Tablename), Tablename [Task] = "Blabla" &&Tablename [ALL]>0))

is only counting the task once even if the value in ALL is 3?

Sorry - i would be eternaly grateful for any more help! 🙂

 

Thanks

Dangar332
Super User
Super User

hi, @WEARLE 


try below

measure =
 CALCULATE ( 
   COUNTROWS ( Tablename), 
   Tablename [Task] = "Blabla" ,
    Tablename [due]=1
 )
gadielsolis
Resolver III
Resolver III

Hello,

 

Please try the following:

 

CALCULATE ( COUNTROWS ( Tablename), Tablename [Task] = "Blabla" &&Tablename [DueDue]=1))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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