Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
My data looks like this..
| PRDT | REG | DAT1 | DAT2 | DAT3 | DAT4 | QTY |
| P1 | US | 8/9/2018 | 12/9/2017 | 1/12/2019 | 10/31/2017 | 100 |
| P2 | EU | 3/9/2018 | 8/29/2017 | 9/9/2018 | 4/8/2017 | 200 |
| P3 | US | 10/1/2018 | 3/7/2017 | 6/22/2018 | 3/17/2017 | 3400 |
| P4 | ME | 12/20/2018 | 9/5/2017 | 1/10/2018 | 11/14/2017 | 400 |
| P1 | EU | 6/19/2018 | 7/27/2017 | 1/23/2018 | 8/15/2018 | 500 |
I am looking for an output like this
| PRDT | REG | MAXDATE | QTY |
| P1 | US | 1/12/2019 | 100 |
| P2 | EU | 9/9/2018 | 200 |
| P3 | US | 10/1/2018 | 3400 |
| P4 | ME | 12/20/2018 | 400 |
| P1 | EU | 8/15/2018 | 500 |
in the powerquery to develop a powerBI dashboard.
My query looks like this [ including the 4 date fields in the ouput] . Tried couple of methods but none of them was successful.
select
MP."PRODT" "PRDT",
MP."AREA" "REG",
MP."EFFDT" "DAT1",
MP."APPDT" "DAT2",
MP."CONSDT" "DAT3",
MP."ENTDT" "DAT4",
(SELECT Max(v) FROM
VALUES ((MP."EFFDT"),( MP."APPDT"), (MP."CONSDT"),(MP."ENTDT")) Value(v)
)
"MaxDate",
MP."quan" "QTY"
from
"_SYS_BIC"."xxxxx" MP
where MP."AREA" IN ('xxx','yyy') and MP."quan" >0
@Anonymous
You can add a custom Column like
=List.Max({[DAT1],[DAT2],[DAT3],[DAT4]})
I tried the above option by adding a custom column, but it is not giving me the MAX Date on Each record.
Infact I was trying to avoid pulling in all these 4 date fields in the query output.
So if I am able to add the MAX Syntax in the power Query (SQL) itself it would be great.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 47 | |
| 29 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 89 | |
| 74 | |
| 39 | |
| 26 | |
| 24 |