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
Anonymous
Not applicable

Measure to show if a PO Number ID was used in the past

Hi Experts

 

Need a measure to show if a PO Number ID was used in the past and if it was the show the result as shown in the table below...

 

PO NumberDateWhen Used In the Past
000003916/12/2021 
000003918/02/202216/12/2021
000035420/03/2020 
000035417/09/202120/03/2020
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Anonymous 

Give this a try.

When Used In the Past = 
VAR _CurrentDate = SELECTEDVALUE ('Table'[Date] )
RETURN
CALCULATE(
    MAX ('Table'[Date] ),
    ALLEXCEPT('Table','Table'[PO Number]),
    'Table'[Date] < _CurrentDate
)

jdbuchanan71_0-1652113342508.png

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@Anonymous 

Give this a try.

When Used In the Past = 
VAR _CurrentDate = SELECTEDVALUE ('Table'[Date] )
RETURN
CALCULATE(
    MAX ('Table'[Date] ),
    ALLEXCEPT('Table','Table'[PO Number]),
    'Table'[Date] < _CurrentDate
)

jdbuchanan71_0-1652113342508.png

 

ribisht17
Super User
Super User

@Anonymous 

 

Prev to Max = CALCULATE(MAX(Sheet3[Date]),FILTER(all(Sheet3),Sheet3[Date] < max(Sheet3[Date])),FILTER(all(Sheet3),Sheet3[PO Number]=max(Sheet3[PO Number])))
 
ribisht17_0-1652113258533.png

 

I added one row from my side to check if it works for more than 2 IDs as well

 

Regards,

Ritesh

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.