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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
zibster
Helper III
Helper III

New Column MAX

Hi,

 

I am trying to add a column that would identifie Max date place "CY" if the date = to max and place "CY" for others, here is my short code that i get error on.

= Table.AddColumn(#"Changed Type", "CyLy", each If(List.Max(#"Changed Type"[txn_dte])=[txn_dte],"CY","LY"))

 

Thanks

Z

1 ACCEPTED SOLUTION
VasTg
Memorable Member
Memorable Member

@zibster 

 

Add a custom column as below.

 

= if [Txn_dte] = List.Max(#"Changed Type"[Txn_dte]) then "CY" else "LY"

 

 

image.png

 

 

Edit: Remember to append previous step name to the column. In my case, "Changed Type" is the previous step and i am referring the date column as List.Max(#"Changed Type"[Txn_dte]) instead of List.Max([Txn_dte])

 

If it helps, mark it as a solution

Kudos are nice too

Connect on LinkedIn

View solution in original post

4 REPLIES 4
VasTg
Memorable Member
Memorable Member

@zibster 

 

Please provide sample data  with expected output to answer the questions correctly.

Connect on LinkedIn

Please see below

 

image.png

 

 

 

VasTg
Memorable Member
Memorable Member

@zibster 

 

Add a custom column as below.

 

= if [Txn_dte] = List.Max(#"Changed Type"[Txn_dte]) then "CY" else "LY"

 

 

image.png

 

 

Edit: Remember to append previous step name to the column. In my case, "Changed Type" is the previous step and i am referring the date column as List.Max(#"Changed Type"[Txn_dte]) instead of List.Max([Txn_dte])

 

If it helps, mark it as a solution

Kudos are nice too

Connect on LinkedIn

Thanks 

 It works perfect 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.