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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Samank75
New Member

How Find Last price with supplier and item wise......

My Table

 

GRNNO   GRNDate   Supplier    Item     Price


A1       2019/01/05     Sup1      Item1        100
A2       2019/01/10     Sup2      Item2      150
A3       2019/01/15     Sup1      Item1       120
A3       2019/01/15     Sup1      Item4       200
A4       2019/01/16     Sup3      Item4       130
A5       2019/01/20     Sup2       Item2      135

 

I need find last price with supplier and Item wise. How can I do it......?

1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Hi @Samank75 

in my answer Last Price is a measure not a calculated column!

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

View solution in original post

10 REPLIES 10
FrankAT
Community Champion
Community Champion

Hi @Samank75 

take a look at the following solution:

 

22-09-_2020_10-56-30.png

 

Last Price item wise = 
CALCULATE(
    MAX('Table'[Price]),
    FILTER(
        ALLEXCEPT('Table','Table'[Item]),
        MAX('Table'[GRNDate]) = 'Table'[GRNDate]
    )
)

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Hi @FrankAT 

Thank you for your code...... When I run this, I can't see some price..... why ?

Capture.JPG

FrankAT
Community Champion
Community Champion

Hi @Samank75 

in my answer Last Price is a measure not a calculated column!

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Why not working to me......

Capture.JPG

amitchandak
Super User
Super User

@Samank75 , Try like

calculate(lastnonblankvalue(table[GRNDate],max(Table[Price])) , allexcept(Table, Table[Supplier],Table[Item]))

or

calculate(lastnonblankvalue(table[GRNDate],max(Table[Price])) , filter(allselected(Table), Table[Supplier] = max(Table[Supplier]) && Table[Item]= max(Table[Item])))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Sorry not working

@Samank75 , Please find the file after the signature . Let me know output needed,if it does not work

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I use this one.

Last Date = VAR SP=Query1[Supplier]

return
MAXX(
FILTER(ALL('Query1'),'Query1'[Supplier]=SP),
'Query1'[GRNDate])
--------------------------------
Its give result , But its not Item wise......

Result should be

GRNNO   GRNDate   Supplier    Item     Price


A3       2019/01/15     Sup1      Item1       120
A3       2019/01/15     Sup1      Item4       200
A4       2019/01/16     Sup3      Item4       130
A5       2019/01/20     Sup2       Item2      135

@Samank75 , GEN no also need to a measure now

File attached after signature

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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