Forum Discussion
Hash2023
2 years agoFrequent Visitor
Help on DAX ( FIRSTNONBLANK)
Hello Team, I need help on a DAX statement: Extra_Purchase_1 = CALCULATE(FIRSTNONBLANK(TransactionJournal[Extra_purchase],1),FILTER(ALL(TransactionJournal),'Id'[hotelregno_id]= TransactionJo...
amitchandak
2 years agoSuper User
Hash2023 , Check
New column in ID table
= Maxx(FILTER(TransactionJournal,'Id'[hotelregno_id]= TransactionJournal[hotelregno_id]), TransactionJournal[Extra_purchase])
New measure with TransactionJournal lookup
Extra_Purchase_1 = CALCULATE(FIRSTNONBLANK(TransactionJournal[Extra_purchase],1),FILTER(ALL(TransactionJournal),'TransactionJournal'[hotelregno_id]= max(TransactionJournal[hotelregno_id])))
Hash2023
2 years agoFrequent Visitor
Hi Amitchandak,
Thank you for your help. It is working but not for all record.
Actually I have a table as below:
| Regno | Extra_date | Extra_type | Extra_purchase |
| 1234 | 30/09/2023 | Extra Revenue | ABCD |
| 1234 | 01/10/2023 | Not Revenue | CBFR |
| 1234 | 29/09/2023 | Extra Revenue | CDAB |
| 1234 | 02/10/2023 | Extra Revenue | FRVJ |
| 2023 | 30/09/2023 | Extra Revenue | ABCD |
It am trying to create a new column where it only returns the Extra_purchase where the
Extra_Type = Extra Revenue
Extra_date = is the first date
for each Regno.
Is it possible?
Many Thanks for your help.
Kind Regards,