## DAX Formula

Anything related to PowerPivot and DAX Formuale
PowerMaths
Posts: 2
Joined: Sun Oct 22, 2017 7:00 pm

### DAX Formula

Dear all,

I try to find a solution regarding my problem below:
I need to have the Max line in the "Texte" column in function of the column criteria below :

- Ste
- Compte
- Type pce
- Date (only with the max date)

The result has to be in my column "TexteMax"

I have created formulas below in columns :

•DateMax :

Code: Select all

`=MAXX(FILTER(Data;[Sté]=EARLIER([Sté]));Data[Date])`

and in column

•TexteMax :

Code: Select all

`=LOOKUPVALUE([Texte];[Date];[DateMax];[Sté];[Sté])`

But it doesn't work. As you can see below, the DateMax is wrong and i have an error in the column "TexteMax" which has to be the final result :

DAX2BIS.PNG (90.34 KiB) Viewed 1203 times

Thank you in advance for your help

MattAllington
Posts: 962
Joined: Sun May 04, 2014 4:01 pm
Location: Sydney, Australia

### Re: DAX Formula

Do you really need this in a column? How about using a measure? I answered a similar question here just yesterday https://www.mrexcel.com/forum/power-bi/ ... -date.html
Matt Allington is Self Service BI Consultant, Trainer and Author of the book "Supercharge Power BI".
https://exceleratorbi.com.au/power-bi-online-training/

PowerMaths
Posts: 2
Joined: Sun Oct 22, 2017 7:00 pm

### Re: DAX Formula

Dear Matt,

Thank you very much for your reply,

but when i applied your solution like below :

Code: Select all

`=CALCULATE (IF ( HASONEVALUE ( 'Data base'[Texte] );VALUES ( 'Data base'[Texte] ) );FILTER ( ALLEXCEPT ( 'Data base'; 'Data base'[Type pce]); 'Data base'[Date] = Max('Data base'[Date]);'Data base'[Compte]);'Data base'[Sté])`

It doesn't work and i get an error message on the FILTER function.

Thank you in advance for your help

Best regards

Return to “PowerPivot/DAX”

### Who is online

Users browsing this forum: No registered users and 4 guests