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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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])))

Share with Power BI Enthusiasts: 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

Share with Power BI Enthusiasts: 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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.