Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

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:

Products Costs =
SELECTCOLUMNS (
FILTER(
'Main Costs','Main Costs'[Department] in { "Shop1" , "Shop2"} &&
'Main Costs'[Product#] <> "N/A" ),
"Product#" , 'Main Costs'[Product#],
"Date" , 'Main Costs'[Date],
"Un Price" , 'Main Costs'[Un Price]
)

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
Pedro

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable
      Spoiler
       

      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