Forum Discussion
DAX, joining a table with itself
Hi
I have a DAX problem, which I simplified. See link to pbix
The Facts table has multiple rows per date per product. First I have to group on product and date. And then I have to get the two distinct products with the max(number). I also have to have the date for that max(number).
So the outcome must be:
- product CC, date 3-1-2020 , number 890 and
- product BB, date 1-1-2020 , number 640
‘Sum per products per day’ is summing the products on day level.
‘Max 2 products’ should give me the two products, but got stuck.
Can somebody help?
https://www.dropbox.com/scl/fi/ls56zi36jks1h2v9ufl4q/testa.pbix?rlkey=ukpbic4d2i1gtxlsdely857uf&dl=0
Regards Ron
Greg_Deckler even your fantastic DAX for Humans serie couldn't help me in this one 😞
Hi Anonymous
Please refr to attached sample file amended with the solution
3 Replies
- tamerj1Community Champion
- AnonymousNot applicable
Thnx tamerj1
Wow, that looks really difficult. A calculate in a calculate.
It works and thnx for that, but for me hard to understand.
Can I order or rank them? I tried adding 'ORDER BY [@Sum] DESC' but that doesn't work.- tamerj1Community Champion
Anonymous
ORDER BY does not work in this case. Just sort the [@Sum] column