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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
tb0493
Frequent 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.

 

Here is a sample data set

ABCDE
2SAMPLE DATA-  ticket dataset
3DateTicket#Process TypeOther columns
41/2/2023100021passedOther details
51/3/2023100022bypassedOther details
61/4/2023100023bypassedOther details
71/5/2023100024bypassedOther details
81/6/2023100025bypassedOther details
91/7/2023100026bypassedOther details
101/8/2023100027passedOther details
111/9/2023100028passedOther details
121/10/2023100029passedOther details
132/1/2023100030bypassedOther details
142/2/2023100031bypassedOther details
152/3/2023100032bypassedOther details
162/4/2023100033bypassedOther details
172/5/2023100034passedOther details
182/6/2023100035passedOther details
192/7/2023100036passedOther details
202/8/2023100037bypassedOther details
212/9/2023100038bypassedOther details
222/10/2023100039bypassedOther details
232/11/2023100040bypassedOther details

 

Here are the excel formulas with results

tb0493_2-1679249561395.png

 

2 ACCEPTED SOLUTIONS
TheoC
Super User
Super User

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 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

tb0493
Frequent Visitor

Thanks! I will give these a try. 🙂

View solution in original post

3 REPLIES 3
tb0493
Frequent Visitor

Thanks! I will give these a try. 🙂

TheoC
Super User
Super User

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 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

andhiii079845
Solution Sage
Solution 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
 
andhiii079845_0-1679251085444.png

 





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

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.