Forum Discussion
Last unit price (part II)
Hi guys
I'm trying to have 1 record for each product cost after adding a column for maxdate and last price.
Let me tell you what i did:
I've created a table in dax from the main one:
Thanks for the help of amitchandak i've manage to add the max date and the max price.
1. I gotta have just one line for each record with product and those 2 column measures
2. Need also to add another condition to the products, (<> null) and DocType (<> Text.StartsWith "R1" or "R2" or "R3")
Believe i try to do it myself by reading documents everywhere and seing youtube videos para for complex filters with SELECTCOLUMNS i found nothing.
Thanks in advance for all the help you can give me, even if you answer just one question.
Best regards
4 Replies
- Greg_Deckler
Community Champion
You should be able to use SUMMARIZE or GROUPBY to create a new table for each Product but difficult to say without knowing what your table looks like exactly. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- AnonymousNot applicable
Hi Greg_Deckler
Thanks for your help.
The real issue here is that i don't underatand how to use summarize or group by with a filter.
It's suppose to create a dax table from Main Costs, with those filters and fields, Product#, Last Date and Last Unit Price.
I did it with power query but i would like to learn how to do it in DAX. Therefore my 2nd point of my first message, about filters.
Is this ok with you?
Thank you so much
Pedro- Greg_Deckler
Community Champion
Sample data would greatly help. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
To use SUMMARIZE or GROUPBY with a FILTER you do something like this:
Table =SUMMARIZE (FILTER('Main Costs','Main Costs'[Department] in { "Shop1" , "Shop2"} && 'Main Costs'[Product#] <> "N/A" ),'Main Costs'[Product#],'Main Costs'[Date],'Main Costs'[Un Price])