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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I want to add sorting for the date to make sure it returns the milestone well ordered by date.
This is the Dax I used
MilestoneTable =
VAR GroupedData =
SUMMARIZE (
'Query3 (3)',
'Query3 (3)'[Product name],
"Milestones",
CONCATENATEX (
'Query3 (3)',
"[" &
"""" & FORMAT('Query3 (3)'[Date], "YYYY-MM-DD") & """," &
"""" & 'Query3 (3)'[Product name] & """," &
"""" & 'Query3 (3)'[Description] & """" &
"]",
","
)
)
RETURN
SELECTCOLUMNS (
ORDER BY( GroupedData, 'Query3 (3)'[Date], ASC ),
"Product name", 'Query3 (3)'[Product name],
"Milestones", IF(COUNTROWS(GroupedData) > 1, "[" & [Milestones] & "]", [Milestones])
)
But I keep getting this error:
The syntax for 'ORDER' is incorrect. (DAX(VAR GroupedData = SUMMARIZE ( 'Query3 (3)', 'Query3 (3)'[Product name], "Milestones", CONCATENATEX ( 'Query3 (3)', "[" & """" & FORMAT('Query3 (3)'[Date], "YYYY-MM-DD") & """," & """" & 'Query3 (3)'[Product name] & """," & """" & 'Query3 (3)'[Description] & """" & "]", "," ) )RETURN SELECTCOLUMNS ( ORDER BY( GroupedData, 'Query3 (3)'[Date], ASC ), "Product name", 'Query3 (3)'[Product name], "Milestones", IF(COUNTROWS(GroupedData) > 1, "[" & [Milestones] & "]", [Milestones]) ))).
Solved! Go to Solution.
Thank you, I figured out that ORDER BY is not a valid expression in calculated table. So I sorted the HTML content viewer using java script. It's fine now.
the correct syntax is
RETURN <something something>
ORDER BY <column>
Thank you, I figured out that ORDER BY is not a valid expression in calculated table. So I sorted the HTML content viewer using java script. It's fine now.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 9 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 20 | |
| 18 | |
| 12 |