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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
srlabhe123
Post Patron
Post Patron

Ranking Without any aggregate expression

Hi Power BI Gurus,

I have below set of data 

 

Customer IdCalendar DateSale IdStanding Order Id
12314-NOV-13 00:00:001526471765911674594922
12305-DEC-13 00:00:001528509907011674594922
12316-DEC-13 00:00:001529203629411674594922
12303-JAN-14 00:00:001530180301715474692288
12317-JAN-14 00:00:001531266056615474692288
12331-JAN-14 00:00:001532469647915474692288
12314-FEB-14 00:00:001533759277715474692288
12328-FEB-14 00:00:001534917049415474692288
12314-MAR-14 00:00:001536146173815474692288

 

 

Now I want an additionla column say SO Instance with value like below, its almost ranking Customer on the base of its SO ID ,Sale ID and Calendar Date

 

Customer IdCalendar DateSale IdStanding Order IdSO Instance
12314-NOV-13 00:00:0015264717659116745949221
12305-DEC-13 00:00:0015285099070116745949222
12316-DEC-13 00:00:0015292036294116745949223
12303-JAN-14 00:00:0015301803017154746922881
12317-JAN-14 00:00:0015312660566154746922882
12331-JAN-14 00:00:0015324696479154746922883
12314-FEB-14 00:00:0015337592777154746922884
12328-FEB-14 00:00:0015349170494154746922885
12314-MAR-14 00:00:0015361461738154746922886

 

The data has mumtiple customer IDs with respective Sae and SO IDs.

 

Appreciate yor help in this.

 

Thanks

Swapnil

1 ACCEPTED SOLUTION

Hi @srlabhe123

 

Try this calculated column

What is the role of Sale ID in RANKING?

 

SO_Instance =
RANKX (
    FILTER (
        ALL ( TableName ),
        TableName[Customer Id] = EARLIER ( TableName[Customer Id] )
            && TableName[Standing Order Id] = EARLIER ( TableName[Standing Order Id] )
    ),
    TableName[Calendar Date],
    ,
    Asc,
    DENSE
)

25.png


Regards
Zubair

Please try my custom visuals

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

check this post



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @srlabhe123

 

Try this calculated column

What is the role of Sale ID in RANKING?

 

SO_Instance =
RANKX (
    FILTER (
        ALL ( TableName ),
        TableName[Customer Id] = EARLIER ( TableName[Customer Id] )
            && TableName[Standing Order Id] = EARLIER ( TableName[Standing Order Id] )
    ),
    TableName[Calendar Date],
    ,
    Asc,
    DENSE
)

25.png


Regards
Zubair

Please try my custom visuals

Great it worked like charm... but not surehow ?

May I have to read more article about Earlier...do you have any that explains in detail

 

Thanks

Swapnil

Hi @srlabhe123

 

This was a little web post I wrote on EARLIER few months back

 

http://www.excelnaccess.com/earlier-in-dax/


Regards
Zubair

Please try my custom visuals

Thanks Zubair

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.