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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Matt_Mohawk
Helper II
Helper II

Latest Revision for Each Proposal Number

I am needing a "1" next to the latest revision for each Proposal #. Below is a screenshot showing some of the data that I am dealing with. The circled values are showing that these are the most recent revisions for each one of the Proposal #. In a separate column I need these to show a 1 next to them.

 

Screen Shot 2021-03-09 at 11.58.02 AM.png

1 ACCEPTED SOLUTION

Hi @Matt_Mohawk ,

You can create a calculated column and use it as a filter in bar chart.

Column = 
var NewRevision = 
    CALCULATE(
        MAX('Table'[Revision #]),
        FILTER(
           'Table',
           'Table'[Proposal #] = EARLIER('Table'[Proposal #])
        )
    )
var result = 
    IF( 'Table'[Revision #] = NewRevision, 1, 0 )
return result

v-kkf-msft_0-1616633996486.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

6 REPLIES 6
AilleryO
Memorable Member
Memorable Member

Hi,

 

If I get well your requirement, you need to filter the lines with the version number being the max ?

If you make a table with your document numbers and a measure (Max Version = MAX(Table[# Revision]) ), it should work, isn't it ?

And if you need to concatenate yourProposal # with the # Revision, just use & :

[ColumnsX] & [ColumnsY] (or the concatenate function)

 

If this does not help you, can you be more specific on your expected outcome to help us guiding you.

@AilleryO 

 

I think you may be close to what I am needing to do. I have an excel document that currently puts a "1" next to the latest revision for each proposal. It allows me to set up a count to figure out how many jobs we have coming through, not including revisions. I just need this to be more automatic so I am trying to gather data using SQL and bypassing Excel altogether. The image below shows the other revisions in red that do not have a "1" next to them. This is telling you that they are old revisions and won't be counted in the end. The line that is marked in orange is telling you that this is the most recent revision and needs to be counted. It also has a "1" next in the column.

 

Screen Shot 2021-03-09 at 1.53.25 PM.png

Hi @Matt_Mohawk ,

Try the following formula:

Measure = 
var NewRevision = 
    CALCULATE(
        MAX('Table'[Revision #]),
        FILTER(
            ALL('Table'),
            'Table'[Proposal #] = MAX('Table'[Proposal #])
        )
    )
var result = 
    IF( MAX('Table'[Revision #]) = NewRevision, 1, 0 )
return 
    IF(
        HASONEVALUE('Table'[Proposal #]),
        result,
        DISTINCTCOUNT('Table'[Proposal #])
)

v-kkf-msft_0-1615439262257.png

This is my PBIX file.

https://microsoftapc-my.sharepoint.com/:u:/g/personal/v-lazhang_microsoft_com/EUX2rPEmq8BPtEoDywcHUO...

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

@v-kkf-msft ,

Thank you for the measure. Sorry it took so long for me to respond. I tried this out and it works great if I have it in a table. The problem that I am running into is that I want it to be able to be used as a filter in a bar graph. Is there a way to make it do that as well?

Hi @Matt_Mohawk ,

You can create a calculated column and use it as a filter in bar chart.

Column = 
var NewRevision = 
    CALCULATE(
        MAX('Table'[Revision #]),
        FILTER(
           'Table',
           'Table'[Proposal #] = EARLIER('Table'[Proposal #])
        )
    )
var result = 
    IF( 'Table'[Revision #] = NewRevision, 1, 0 )
return result

v-kkf-msft_0-1616633996486.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

@v-kkf-msft ,

 

This was what I needed! Thank you so much! You are a genius!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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