The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi guys,
I have a column with countries and would like to count occurences in a spearate colum as shown below:
Countries Occurence Count
France 1
England 1
Germany 1
France 2
China 1
France 3
How can I create the "Occurence Count" column please?
Thanks!
Solved! Go to Solution.
First add an Index Column from Query Editor
Then you can Rank that Index for each Country to get the Occurrence Count as follows
Occurence Count = RANKX ( FILTER ( Table1, Table1[Countries] = EARLIER ( Table1[Countries] ) ), [Index], , ASC )
First add an Index Column from Query Editor
Then you can Rank that Index for each Country to get the Occurrence Count as follows
Occurence Count = RANKX ( FILTER ( Table1, Table1[Countries] = EARLIER ( Table1[Countries] ) ), [Index], , ASC )
Thanks Zubair! It worked perfectely, I didn't know Inderx column as I am still new using with Power BI.
One question though: my Dashboard takes now a lot more time to Refresh, could it be because of the Index column I added.
Seems like it's taking a lot of memory. Or is it something else?