Forum Discussion
COUNTROW based on the Text
- 5 years ago
Hi, Saxon10 ,
You could create measure and column by the following formula:
Step1:create a columnWITHITEM = SWITCH(TRUE(),[SALES CODE] in {"9001","9002","9003","9004"},"NOT OKAY",[SALES CODE]<>BLANK(),"OKAY")And if you want to COUNTROW based on the Text:
count = CALCULATE(COUNTROWS('DATA'),FILTER(ALLEXCEPT('DATA','DATA'[ITEM]),[SALES CODE] in{"9001","9002","9003","9004"}))The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for your respones again.
Here is the file for your reference https://www.dropbox.com/s/ux966h65am91wx2/IN.pbix?dl=0
I am trying to inculde the item by using the following DAX formula but I am receving error.
Hi,
The entries in the desired result column do not match with the entries in the WIth Item column column but atleast your error is gone away with this formula
WITH ITEM = IF(CALCULATE(COUNTROWS(DATA),FILTER(DATA,DATA[ITEM]=EARLIER(DATA[ITEM]) && DATA[SALES CODE] IN {"9001","9002","9003","9004"})),"OKAY","NOT OKAY")
I guess that is all i can help you with.
- Saxon105 years ago
Post Prodigy
Thanks for your reply and help.
Still it's giving wrong results.