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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MikeHunt
Regular Visitor

Create a column which generates revision ID based on Status column

I have Code, Status, Created (date) columns in my Power BI data. I want to create a another column named Revision Number column that will filter per Code and group one revision with ID. All revisions starts Initiated and ends with Approved.

 

Example below.

 

MikeHunt_1-1710927047388.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @MikeHunt 

I use the data shown in your image as shown below:

vjianpengmsft_0-1711012778490.png

First, I created an Index column using PowerQuery:

vjianpengmsft_1-1711012869567.png

vjianpengmsft_2-1711012889365.png

I created the Revision Number column using the following DAX expression:

Revision Number =
RANKX (
    FILTER (
        'Table',
        'Table'[Status] = "Approved"
            && 'Table'[Code] = EARLIER ( 'Table'[Code] )
    ),
    'Table'[Index],
    ,
    ASC,
    SKIP
)

Here are the results:

vjianpengmsft_3-1711013013535.png

I've provided the PBIX file for this time below, and it would be great if I could help you.

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi, @MikeHunt 

I use the data shown in your image as shown below:

vjianpengmsft_0-1711012778490.png

First, I created an Index column using PowerQuery:

vjianpengmsft_1-1711012869567.png

vjianpengmsft_2-1711012889365.png

I created the Revision Number column using the following DAX expression:

Revision Number =
RANKX (
    FILTER (
        'Table',
        'Table'[Status] = "Approved"
            && 'Table'[Code] = EARLIER ( 'Table'[Code] )
    ),
    'Table'[Index],
    ,
    ASC,
    SKIP
)

Here are the results:

vjianpengmsft_3-1711013013535.png

I've provided the PBIX file for this time below, and it would be great if I could help you.

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.