Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello!
I have a DAX code allowing me to output a table, which I use then in other systems (PowerAutomate) to communicate via mail to users.
It needs to be ranked, however it is super annoying to see the [Rank] column in the final mail table; and I had to use a [Rank] column, as the standard date column I would simply use needs to be formatted for later consumption (otherwise it gets the universal time format in Powerautomate and it becomes difficult to read).
Anyway, question is: is there a way to pre-order the final table, so that I can eliminate the column [Rank] from it but still have it ordered by [Unit] - which I want to keep - and [Rank]? I have been playing with it way too long, hence coming to the experts 🙂
I am leaving the whole code for completeness, I have highlighted the [Rank] parts in red, and the final table I am talking about is the one after the RETURN statement.
Thank you!
Kind regards
Valeria
Solved! Go to Solution.
The argument for ORDER BY doesn't need to be in the table you're ordering, it can be a measure or an expression. Try
ORDER BY [Unit], DATEVALUE( [Prod. Date] ASC
The argument for ORDER BY doesn't need to be in the table you're ordering, it can be a measure or an expression. Try
ORDER BY [Unit], DATEVALUE( [Prod. Date] ASC
@johnt75 I love this solution! I don't know how I missed that you could use measures or expressions in ORDER BY. Thank you!!!!!
Instead of using ORDER BY use TOPN with a very large number. TOPN returns the top N rows sorted by the specified columns.
RETURN
SELECTCOLUMNS(
TOPN( 100000, -- large number to include all rows
RankedTable,
[Unit], ASC, [Rank], ASC ),
[Unit],
[Change Type],
[Delta Old/New],
[Reprint?],
[Prod. Date],
[PO],
[Change Detail],
[Old Value],
[Old Date],
[New Value],
[GMID],
[Product],
[Batch],
[Model],
[Send to SAP Date/Time]
)
I hope this helps, please give kudos and mark as solved if it does, thanks!
User | Count |
---|---|
13 | |
10 | |
8 | |
7 | |
5 |
User | Count |
---|---|
24 | |
16 | |
15 | |
10 | |
7 |