Forum Discussion
tb0493
3 years agoFrequent Visitor
Using "Count" function in DAX for attribute data
Hello, I'm trying to figure out how to perform these Excel formulas in DAX, I'm thinking it's either using COUNTX or COUNTAX and then getting the percent in a visual. Any help would be appreciated. ...
- 3 years ago
Hi tb0493
You can use the following:1. Count all records = COUNTROWS ( 'TableName' )
2. Count if records "bypassed" =CALCULATE (
[Count all records] ,
FILTER ( 'TableName' , TableName[Processed Type] = "bypassed" ) )
3. Divide = DIVIDE ( [Count if records "bypassed"] , [Count all records] , 0 )
Attached is a PBIX File to assist.
Hope this helps 🙂
- 3 years ago
Thanks! I will give these a try. 🙂
andhiii079845
3 years agoSolution Sage
Try this:
Measure =
VAR _all = COUNTAX(ALLSELECTED('Table'),'Table'[Ticket#])
VAR _bypassed = COUNTAX(FILTER(ALLSELECTED('Table'),'Table'[Process Type]="bypassed"),'Table'[Ticket#])
RETURN _bypassed/_all