Count occurrences in DAX

0 votes

I need to count the no of occurrences of each value in the column with duplicates from the table mentioned below

Column A

1

2

3

1

2

3

4

I need 

Column A

Occurrence

1

2

2

2

3

2

1

2

2

2

3

2

4

1

Mar 8 in Power BI by Phalguni
• 1,010 points
907 views

1 answer to this question.

0 votes

You can use DAX functions to do so, which will be:

Occurence = 
COUNTX (
    FILTER ( yourTable, EARLIER ( yourTable[Col A] ) = yourTable[Col A] ),
    yourTable[Col A]
)

COUNTX -This function Counts the number of rows of that table that contain a number or an expression that evaluates to a number when evaluating an expression over 

answered Mar 9 by Avantika
• 1,500 points

Related Questions In Power BI

0 votes
1 answer

DAX : Occurrences of "count"

Try this for creating a calculated column ...READ MORE

answered Nov 21, 2018 in Power BI by Upasana
• 8,530 points
598 views
0 votes
1 answer

Distinct count filtered by condition using Power BI Dax

Try this, it should work: DistinctCountActiveMonths = CALCULATE( ...READ MORE

answered Oct 5, 2018 in Power BI by Kalgi
• 40,460 points
6,249 views
0 votes
1 answer

Dax query in power bi

Here is my table before I have ...READ MORE

answered Oct 22, 2018 in Power BI by Hannah
• 14,070 points
75 views
0 votes
1 answer

list reports with calculated percentage in Power BI using dax

Create a Measure called Total Revenue: Total Revenue = SUMX( ...READ MORE

answered Oct 22, 2018 in Power BI by Hannah
• 14,070 points
99 views
0 votes
1 answer

How to calculate cumulative Total and % in DAX?

Hi, If your table is ready with percentage ...READ MORE

answered Mar 18 in Power BI by Cherukuri
• 25,900 points
1,126 views
0 votes
1 answer

Dax: Sum of values from many columns in a row

Yes, you can. Try to "Unpivot other columns" ...READ MORE

answered Apr 3 in Power BI by Upasana
• 8,530 points
307 views
0 votes
1 answer

count of string in pie chart

Hi Prakash, Select the measure and measure that ...READ MORE

answered May 7 in Power BI by Cherukuri
• 25,900 points
27 views
0 votes
1 answer

How to rename a column using DAX in Power BI?

Hi Ramya, I found these two function that ...READ MORE

answered Aug 21 in Power BI by anonymous
• 25,900 points
42 views
0 votes
1 answer

How do you create a link visual in Power BI?

You can easily create a link between ...READ MORE

answered Mar 8 in Power BI by Avantika
• 1,500 points

edited Mar 9 by Avantika 66 views
0 votes
1 answer

How do I convert month format in Power BI?

Hi, This can easily be done using DAX ...READ MORE

answered Mar 26 in Power BI by Avantika
• 1,500 points
96 views