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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
jgtirz
New Member

Using CALCULATE when filter removes all data

I got the following example

 

ProviderProjectLicitationOrder
1AX1
1A-2
1BY3
2B--
2BZ-
3A-4
3C-5
3C-6

 

And i want a matrix/pivot table that counts for each provider how many projects/licitations/order has been involved in (not counting it therefore when a  "-" appears).

 

The thing is that if I filter out directly these value, whenever a "-" appears for any column it will filter out all the row. Counting only the rows that contains value in all three columns (not even that because provider 3 should get all 0 based on that logic...):

 

PROVIDERPROJECTSLICITATIONSORDERS
1222
2111
3111

 

Using a new measure using =CALCULATE for each column throws an error, because for example for provider 3 if you filter out "-" on licitation you filter out everything and gets empy.

 

How would I fix it?

 

The final result should look like:

 

PROVIDER# of PROJECTS# of LICITATIONS# of ORDERS
1223
2110
3203

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@jgtirz Maybe 3 measures:

 

# of PROJECTS = COUNTROWS('Table') + 0

# of LICITATIONS = COUNTROWS(FILTER('Table',[Licitation]<> "-")) + 0

# of ORDERS = COUNTROWS(FILTER('Table',[Order] <> "-")) + 0

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@jgtirz Maybe 3 measures:

 

# of PROJECTS = COUNTROWS('Table') + 0

# of LICITATIONS = COUNTROWS(FILTER('Table',[Licitation]<> "-")) + 0

# of ORDERS = COUNTROWS(FILTER('Table',[Order] <> "-")) + 0

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Cheers mate, that "+0" did the trick!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.