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.
In Power Query, I have a table which has a date column. I want to write a custom column that checks if the date is the minimum date for that field, then return true, else false.
if List.Contains({List.Min(#"Table"[Date])},[Date]) then true else false
Do I need to have a separate object for comparison? I would never use this minimum date in another location, and if possible would like to avoid creating a referenced table or something similar.
Solved! Go to Solution.
Hi @Anonymous,
To get the minimum date in a column, please refer to this syntax:
AddCustom = Table.AddColumn(PreviousStep, "Custom", each List.Max(PreviousStep[a]))
Then, wrap above step inside an if condition.
= Table.AddColumn(#"Changed Type", "Custom.1", each if [Date]=List.Min(#"Changed Type"[Date]) then "true" else "false")
Best regards,
Yuliana Gu
Hi @Anonymous,
To get the minimum date in a column, please refer to this syntax:
AddCustom = Table.AddColumn(PreviousStep, "Custom", each List.Max(PreviousStep[a]))
Then, wrap above step inside an if condition.
= Table.AddColumn(#"Changed Type", "Custom.1", each if [Date]=List.Min(#"Changed Type"[Date]) then "true" else "false")
Best regards,
Yuliana Gu
Hello @v-yulgu-msft,
what condition would I need to add in order to get the minimun date for each site?
Best Regards
@ratercero I ended up just bringing in a second reference to the table for another situation, grouping on the ID and value, then merging it in to make it work. I found that even if I could make more of it work in a single step that it ended up hurting readability for anyone else coming in after me.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |