DAX : Occurrences of "count"

0 votes

So I have a table;

Now, I want to apply some dax instructions to that table, and display this data in a chart. In other words,  if it is the first time that the Country's name appears, it must show 1 and 2 for the second time.

Can anybody help me? Thanks.

Nov 21, 2018 in Power BI by Shubham
• 13,310 points
759 views

1 answer to this question.

0 votes

Try this for creating a calculated column called Occurrences:

Occurrences =
CALCULATE (
    COUNT ( [Pais] ),
    FILTER (
        'Table',
        [Index] <= EARLIER ( 'Table'[Index] )
            && [Pais] = EARLIER ( 'Table'[Pais] )
    )
)

Index must be an incremental key in each row.

Let me know if this helps.

answered Nov 21, 2018 by Upasana
• 8,550 points

Related Questions In Power BI

0 votes
1 answer

Count occurrences in DAX

You can use DAX functions to do ...READ MORE

answered Mar 9 in Power BI by Avantika
• 1,500 points
1,658 views
0 votes
1 answer

Max count of workspaces per one PRO user

Right now, it is 250, will be ...READ MORE

answered Sep 24, 2018 in Power BI by Hannah
• 16,590 points
35 views
0 votes
1 answer

Calculating MoM Variance of a Measure Field using DAX

Create an intermediate calculated column that considers ...READ MORE

answered Feb 28 in Power BI by Shubham
• 13,310 points
1,028 views
0 votes
1 answer

Add Column Count_of_people across two tables to get the count of people from a city.

Hi Anitha, 1. Merge both tables, using City ...READ MORE

answered Mar 22 in Power BI by Cherukuri
• 31,840 points
37 views
+3 votes
2 answers

Combine tables in Power BI

You can also achieve this using a ...READ MORE

answered Oct 5, 2018 in Power BI by lina
• 8,110 points

edited Oct 11, 2018 by Kalgi 217 views
0 votes
1 answer

Power Bi Dax Table

You need to wrap the numbers in ...READ MORE

answered Oct 5, 2018 in Power BI by Kalgi
• 42,470 points
107 views
0 votes
2 answers

Power BI Dax Multiple IF AND Statements

HI I have Column Patient 12 13 14 15 18 IN Patient=12, 13 Out ...READ MORE

answered May 22 in Power BI by VNK
9,077 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
• 42,470 points
8,869 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,550 points
742 views
0 votes
1 answer

Calculate Time Intersection to Correlate Sequences of Independent Events

I think this solution requires a CROSS JOIN implementation. ...READ MORE

answered Oct 26, 2018 in Power BI by Upasana
• 8,550 points
54 views