Forum Discussion
DAX beginners question
Created this measure based on the formula below but no data is returned. The MessageStatusCode field is varchar not numeric which is why I used VALUE
"TotalTxts2 = CALCULATE( COUNTROWS('pas tbl_OPSMSSent'), FILTER(VALUES( 'pas tbl_OPSMSSent'), 'pas tbl_OPSMSSent'[MessageStatusCode] = "0" ) )"
"ColorGreen = CALCULATE( COUNTROWS(‘Demo’), FILTER( VALUES(‘Demo'[Color]), ‘Demo'[Color] = “Green” ) )"
Thanks for reply, I posted again as wasn't getting any replies and got the solution I needed.
TotalTxts2 = CALCULATE( COUNTROWS('pas tbl_OPSMSSent'),FILTER('pas tbl_OPSMSSent',trim('pas tbl_OPSMSSent'[MessageStatusCode])="0"))
7 Replies
- Fowmy
Super User
- WDHB01
Helper I
It should return a count of all rows that have a column value of "0"
[MessageStatusCode] = "0"- Fowmy
Super User
WDHB01
Try this please:TotalTxts2 = CALCULATE( COUNTROWS('pas tbl_OPSMSSent'), 'pas tbl_OPSMSSent'[MessageStatusCode] = 0 )________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
- v-easonf-msft
Community Support
Hi, WDHB01
The formula needs a small change:TotalTxts2 = CALCULATE( COUNTROWS('pas tbl_OPSMSSent'), 'pas tbl_OPSMSSent'[MessageStatusCode] = "0" )If it doesn't meet your requirement,please share your sample data for futher research.
Best Regards,
Community Support Team _ Eason- WDHB01
Helper I
Thanks for reply, I posted again as wasn't getting any replies and got the solution I needed.
TotalTxts2 = CALCULATE( COUNTROWS('pas tbl_OPSMSSent'),FILTER('pas tbl_OPSMSSent',trim('pas tbl_OPSMSSent'[MessageStatusCode])="0"))
- v-easonf-msft
Community Support
Hi, WDHB01
Thank you for your sharing.
If your problem has been solved, you can accept your reply as Solution to close this thread.
More people will learn new things here.Best Regards,
Community Support Team _ Eason