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, 2019 in Power BI by Phalguni
• 1,010 points
8,457 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, 2019 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,590 points
1,915 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
• 51,890 points
20,928 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
• 18,070 points
193 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
• 18,070 points
278 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, 2019 in Power BI by Cherukuri
• 32,460 points
7,681 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, 2019 in Power BI by Upasana
• 8,590 points
2,824 views
0 votes
1 answer

count of string in pie chart

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

answered May 7, 2019 in Power BI by Cherukuri
• 32,460 points
218 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, 2019 in Power BI by anonymous
• 32,460 points
4,452 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, 2019 in Power BI by avantika
• 1,500 points

edited Mar 9, 2019 by avantika 188 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, 2019 in Power BI by avantika
• 1,500 points
2,340 views