Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
EDO_01_1789
Helper I
Helper I

Previous date dax or M

Hello 

yes I would like your help about a probleme

I have put below a table of what I want :

Fichier ExcelValidator NameValidation datePrevious validator date
 Excel File  AValidator n° 111/08/2022 
 Excel File  AValidator n° 212/08/202211/08/2022
 Excel File  AValidator n° 313/08/202212/08/2022
 Excel File  AValidator n° 414/08/202213/08/2022
 Excel File  AValidator n° 515/08/202214/08/2022
 Excel File  BValidator n° 102/08/202215/08/2022
 Excel File  BValidator n° 203/08/202202/08/2022
 Excel File  BValidator n° 304/08/202203/08/2022
 Excel File  BValidator n° 405/08/202204/08/2022
 Excel File  BValidator n° 506/08/202205/08/2022
 Excel File  CValidator n° 101/07/202206/08/2022
 Excel File  CValidator n° 202/07/202201/07/2022
 Excel File  CValidator n° 303/07/202202/07/2022
 Excel File  CValidator n° 404/07/202203/07/2022
 Excel File  CValidator n° 505/07/202204/07/2022

 

I can't create the last column in M or DAX.

if anyone could help me it would be very useful

I just want to make sure that the validator 1 of each excel file does not have a previous date.

The validator 2 must have the validation date of the validator 1
The validator 3 must have the validation date of the validator 2
Validator 4 must have the validation date of validator 3
The validator 5 must have the validation date of the validator 4

Thanks for your help,

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @EDO_01_1789 ;

You could create a measure by dax.

 

Measure = 
CALCULATE(MAX('Table'[Validation date]),
FILTER(ALL('Table'),[Fichier Excel]=MAX('Table'[Fichier Excel])&&[Validation date]<MAX('Table'[Validation date])))

 

the final show:

vyalanwumsft_0-1661162364944.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @EDO_01_1789 ;

You could create a measure by dax.

 

Measure = 
CALCULATE(MAX('Table'[Validation date]),
FILTER(ALL('Table'),[Fichier Excel]=MAX('Table'[Fichier Excel])&&[Validation date]<MAX('Table'[Validation date])))

 

the final show:

vyalanwumsft_0-1661162364944.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test (later on when you use the query on your dataset, you will have to change the source appropriately. If you have columns other than these, then delete Changed type step and do a Changed type for complete table from UI again)

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jdExCoNAFATQqyxbu/D3765JmwQ9go1YSLQQlgRCihwrZ8jJtBwccNN+XjEzv+9t87nP2bRLns3FVrYb8zKN7+fLPH5f47eLiqqTs/PeDlXBK3ot+4A+lH1EH8s+oU97fz3sK5SfPfYVys8e+wrlZ4995Y/82Ffqvb8d9D05of+yV/S0D/uAnvZhH9HTPuwT+m2fYQU=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Fichier Excel" = _t, #"Validator Name" = _t, #"Validation date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Fichier Excel", type text}, {"Validator Name", type text}, {"Validation date", type date}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
    BuffList = List.Buffer(#"Changed Type"[Validation date]),
    #"Added Custom" = Table.AddColumn(#"Added Index", "Previous validator date", each try BuffList{[Index]-1} otherwise null),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"})
in
    #"Removed Columns"

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.