Forum Discussion
Create Customer table from Sale table with multiple Customer Names
- 3 years ago
Dear DOLEARY85 ,
I have tried and some old names still because of FIRSTNONBLANK function I think.
So, I tried with LASTDATE function of Order date and it gave me the expected results.
Pbix file is not able to share for me.
So, Please check the screenshot and let me know your thought.
Thanks a lot for your help.
Best Regards,
KMT
Sorry i think i may have misread what you wanted, so if you wanted another version of the table with those 5 fields but without blank customers you could summarize a new table:
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Dear DOLEARY85 ,
Actually I only want two columns with Customer ID and Custoumer Name
Where both are not blanks.
The below code are nearly working properly but some customers still getting old name.
I think it is better to filter the max Order Date than Order ID because
some reversal sale comes by larger order ID. Thanks.
Please help again.
- DOLEARY853 years agoResident Rockstar
Okay, it's an easy change then, just change Order ID to Order Date and it'll work the same way:
New Table =FILTER(ADDCOLUMNS(DISTINCT('Table'[CUSTOMER ID]),"Customer Name", CALCULATE(FIRSTNONBLANK('Table'[CUSTOMER NAME],CALCULATE(MAX('Table'[ORDER DATE]))))),NOT('Table'[CUSTOMER ID]=""))If I answered your question, please mark my post as solution, Appreciate your Kudos 👍- KyawMyoTun3 years agoHelper IV
I've test that one but still some customers getting old name.
- DOLEARY853 years agoResident Rockstar
Could you share a couple of the records with the old and new names so i can test why they're not changing. Or could you share you PBIX file?
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍