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.
Hey Guys,
Can you help me with the following? I need syntax that gives me the most recent date from 3 different date columns.....something like this:
Opend Date: Pending Date: Close Date: Max Date from the 3:
1/2/2015 1/4/2015 1/5/2015 X
In tableau it's just a max function. Let me know if you can help me out. Thanks guys
Joe
Solved! Go to Solution.
Well, if it's just 3, try this:
SWITCH(True(),
D1 > D2, IF(D1 > D3, D1, D3),
True(), IF(D2 > D3, D2, D3)
)
And in case your data is from SQL Server, you can calculate it in the query. For example:
Well, if it's just 3, try this:
SWITCH(True(),
D1 > D2, IF(D1 > D3, D1, D3),
True(), IF(D2 > D3, D2, D3)
)
And in case your data is from SQL Server, you can calculate it in the query. For example:
If you would do this in the query editor instead, your M-code would actually resemble the Tableau syntax:
List.Max({[#"Opend Date:"],[#"Pending Date:"],[#"Close Date:"]})
There are some performance aspects of M vs DAX as well.
https://blog.oraylis.de/2016/02/relative-week-column-with-dax-power-query/
"...Actually the Power Query version is slightly faster, because the Vertipaq-Engine can do a better compression with a column which is set during data load. The DAX generated columns will be created during processing the model. This has two negative impacts. First the compression won’t be as good and second every time the cube is processed, for example when a new measure is created, Power BI Desktop will recreate the two columns, which will take more time..."
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Anyone any idea why the editor keeps eating the closing brackets?
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
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 |
---|---|
114 | |
100 | |
78 | |
75 | |
50 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |