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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Atinder
Helper III
Helper III

Find Last purchase cost

Hello, 

 

I am need to Find my last invoiced purchased price and last Invoiced date. If there is no invoice leave it blank . I found the last invoice date with measure. 

Date of Invoice = LASTDATE( 'Query2'[Posting_Date]). 
 
I have 3 tables- 1 Sku's with decsription- vendor info, average unit cost
2: item ledger - all invoiced with date and price
3. Date table.
Atinder_0-1666213269160.png

 

on table I pulled SKU  and unit cost from table1 and Date of invoice from table 2.  It pulls my cost per unit as Sum. When I select don't summerize  all Blank LAST purchase date goes away? How can I keep all blanks date of purchase and cost (dont' summerize)?

 

Atinder_2-1666213476519.png

 


Thank you!

 
 
 
1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Atinder ,

 

Check the formulas:

last_date = CALCULATE(MAX('Purchase Rec'[Date Invoiced]),ALLEXCEPT('Purchase Rec','Purchase Rec'[Sku]))

last cost = CALCULATE(MAX('Purchase Rec'[COST]),FILTER(ALLEXCEPT('Purchase Rec','Purchase Rec'[Sku]),'Purchase Rec'[Date Invoiced]=[last_date]))

vjaywmsft_0-1666939191434.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @Atinder ,

 

Check the formulas:

last_date = CALCULATE(MAX('Purchase Rec'[Date Invoiced]),ALLEXCEPT('Purchase Rec','Purchase Rec'[Sku]))

last cost = CALCULATE(MAX('Purchase Rec'[COST]),FILTER(ALLEXCEPT('Purchase Rec','Purchase Rec'[Sku]),'Purchase Rec'[Date Invoiced]=[last_date]))

vjaywmsft_0-1666939191434.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
v-jayw-msft
Community Support
Community Support

Hi @Atinder ,

 

Please share some sample data and expected result.

How to Get Your Question Answered Quickly - Microsoft Power BI Community

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

hello@v-jayw-msft,

 

Here is link to my sample data.

 

Cost.pbix

 

Here is what I wanted to see.

Sku ListDisSystem PriceLast Invoice dateCost
DIS-198Item-1$1.251/6/2022$8

 

Thank you!

 

Password for the file is 123456.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.