cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
misiek5510
Frequent Visitor

Count Custom Dax Column

Hi,

 

I have measure that is an if statement and gives either "completed" or "not completed" output in a table and is called warehouse status. Now I have a table that display's everything correctly, but I'd like to create additional table that will be a summary table and will count how many "completed" and "not completed" there are. 

Example:

Check= CALCULATE ( COUNT ( Base[Warehouse Status] ), Base[Warehouse Status] = "Completed" ) For example this formula will not work as it won't find the bit in red and all formulas I find online work the same way!.

Help

1 ACCEPTED SOLUTION

You can use it within a count like this:

COUNTROWS ( FILTER ( Base, [Warehouse Status] = "Completed" ) )

 

I don't know if this is what you're actually trying to count though.

View solution in original post

16 REPLIES 16
misiek5510
Frequent Visitor

Hi guys,

 

 

I've edited the original message with the actual data. Below is the error I'm getting.

misiek5510_0-1634842193540.png

 

From this screenshot, it's apparent that [Warehouse Status] is a measure, not a column. This is why you cannot use it inside COUNT or as part of a boolean filter argument.

Yes it is a measure. Is there no way to perform a count on it? 

 

You can use it within a count like this:

COUNTROWS ( FILTER ( Base, [Warehouse Status] = "Completed" ) )

 

I don't know if this is what you're actually trying to count though.

View solution in original post

Thank you very much just what I needed. 

parry2k
Super User
Super User

@misiek5510 Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





parry2k
Super User
Super User

@misiek5510 it is not very helpful when you say it doesn't work? You are getting errors? if yes, what is that error or you are getting the wrong result. I think it is the first one, so if you can provide more details on the error that will help. You are just showing the measure you are doing but not what and how you are using it and what error/issue you are getting.

 

 






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





I don't have access to it atm but might be able to get it later on but for sure tomorrow. (since not providing a lot of information as can not remember everything). 

AlexisOlson
Super User
Super User

Can you share an example file or any other way that we can reproduce what you're seeing?

Sorry Alexis it is in fact a measure not a calculated column! Sorry for confusion. 

THe error i get is : Column "Yes" in table "Table1" can not be found or may not be used in this expression.

 

parry2k
Super User
Super User

@misiek5510 maybe this is the issue with the IntelliSense, even if shows no column found, does the measure still works?

 

Just to confirm, you are adding this as a measure? Correct?






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Yes adding it as a measure, and it does not work.

misiek5510
Frequent Visitor

Yes basically when I get as far as:

Yes = CALCULATE ( COUNT ( Table1[Col1] ),
It will find Table1 but will not find Col1 and it just highlights it
 (No measures are shown), but when the reamaining of the forula is typed :

Table1[Col1] = "Yes" )   
in the second part it finds the Table1 and Col1 fine.

 

Does it makes sense?

Can you verify that [Col1] is a calculated column rather than a measure?

 

The icon will look different (a table vs a calculator).

Yes it was created in Data View > New Column, I think that's a calculated column. Its not a measure but measures are also not visible when trying to use the formula above. 

misiek5510_0-1634749947142.png thats the icon. 

 

AlexisOlson
Super User
Super User

It's not clear to me what you mean by "this formula will not work". Can you show what you're currently getting and explain how it differs from what you expect to get?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.