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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.