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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Omar8787
Frequent Visitor

filter column

Dear all,

I need your support in writing a DAX formula.

Situation
I have a table containing a column "PurchaseOrderDocumentReference" there are several confirmations in each Purchase Order. So, I want to filter the latest confirmation of the column. How to do that?

Best Regard

 

multi confarmation in PO.jpg

1 ACCEPTED SOLUTION

Okay,

Now it depends if you need calculated column or measure, but I will cover both.
1. You need to create new column, where you extract the last digit. So you should have two columns. One with only pure PO and second with "version":

Migasuke_0-1674304209623.png

The best way how to do this is in Power Query, for example with extract options:

Migasuke_1-1674304311665.png


2. Once you have your two columns, you can create conditional DAX column, which defines last version. Formula looks like this:

 

 

obrazek.png
At this point, you can use this column for filtering you report. You just need to check "Latest".

3. In case you want to create a measure, you can now use this column for measures. Let's say each of my order has also value. If we want to sum value only for latest PO, we can do it:
Last Value for POs = CALCULATE(SUM('Table'[Value]),'Table'[Last Version] = "Latest")



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

View solution in original post

5 REPLIES 5
Migasuke
Memorable Member
Memorable Member

@Omar8787,

can you give more info? For example, why do you have highlighted some numbers in your screenshot or do you have any date, we could use?

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

my highlight is an example of how the PO number duplicates and the difference is only the last digit of each rows

 

So if I understand well:
You want to filter purchase orders with the highest number at the end? So for example: PO-00000-3 and PO-00010-3?

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Yes, Correct 

Okay,

Now it depends if you need calculated column or measure, but I will cover both.
1. You need to create new column, where you extract the last digit. So you should have two columns. One with only pure PO and second with "version":

Migasuke_0-1674304209623.png

The best way how to do this is in Power Query, for example with extract options:

Migasuke_1-1674304311665.png


2. Once you have your two columns, you can create conditional DAX column, which defines last version. Formula looks like this:

 

 

obrazek.png
At this point, you can use this column for filtering you report. You just need to check "Latest".

3. In case you want to create a measure, you can now use this column for measures. Let's say each of my order has also value. If we want to sum value only for latest PO, we can do it:
Last Value for POs = CALCULATE(SUM('Table'[Value]),'Table'[Last Version] = "Latest")



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.