I have the following table:
Now, I want to apply some dax instructions to that table, and display this data in a chart:
Or in other words, I if it is the first time that the Country's name appears, it must show 1
and 2
for the second time.
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.