Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply

Order Rank on Sales Data

Hi,

 

I'm struggling to add a new column to my dataset using a dax calculated column. I want it to look something similar to this:

 

findingsolution_0-1653872692657.png

 

Columns A-D are in my dataset, and I want it to have a running count so that every time a distinct email plays for an order, their count will go up by 1. This way, I'll be able to see how many times a product is the first bought item (ie to find out if Apples is the most purchased first item, then bananas etc).

 

Any help would be super appreciated!

 

2 ACCEPTED SOLUTIONS
ribisht17
Super User
Super User

@findingsolution 

 

Rank= RANKX(FILTER(all('Rank'),'Rank'[email]=EARLIER('Rank'[email])),'Rank'[date],,ASC,Dense)
 
Regards,
Ritesh

Regards,

Ritesh

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula

Order rank = calculate(countrows(Data),filter(Data,Data[Email]=earlier(Data[Email])&&Data[payment date]=earlier(Data[payment date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula

Order rank = calculate(countrows(Data),filter(Data,Data[Email]=earlier(Data[Email])&&Data[payment date]=earlier(Data[payment date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ribisht17
Super User
Super User

@findingsolution 

 

Rank= RANKX(FILTER(all('Rank'),'Rank'[email]=EARLIER('Rank'[email])),'Rank'[date],,ASC,Dense)
 
Regards,
Ritesh

Regards,

Ritesh

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.