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.
Hi everyone,
Maybe some one could help me in this question.
In dax I have some table:
ID ORDER RESULT
121212 1 1
121212 2 1
121212 3 1
If I have by the same ID ORDER 1 and ORDER 2 please give me just ONE RESULT, THEN 1.
If I have diferents ID let it so.
Thank you.
Solved! Go to Solution.
@Anonymous
You may use DAX below to add a calculated column.
Column =
MINX (
FILTER ( 'Table', 'Table'[ID] = EARLIER ( 'Table'[ID] ) ),
'Table'[ORDER]
)
Alright, just as a bit of feedback: the WHOLE CAPS THING kinda makes it seem like you are screaming 😉 It is not necessary, there are a lot of people willing to help you out if you formulate your question to the point and complete.
To your question: what are you expecting as a result? Do you want a filter? Are you expecting one value (the value of column RESULT)?
If you want to get a filter context where you only get the row with the lowest ORDER, then try this:
VAR curID = Table[ID]
VAR minOrder = CALCULATE(MIN(Table[ORDER]), FILTER(ALL(Table), Table[ID] = curID))
RETURN
FILTER(Table, Table[ID] = curID && Table[ORDER] = minOrder)
These are parts of valid DAX but without knowing what your expected result is, we can't provide you with a solid answer.
Your logic is clear, you expected output isn't.
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Proud to be a Super User!
Thank you for your answer djerro123,
what I expect to do is to get just one order number.
ID ORDER NR (ORDER NR2)
121212 1 1
121212 2 1
121212 3 1
121200 1 1
121201 2 2
121212 4 1
131313 3 3
131313 4 3
141414 2 2
141414 3 2
What I supose to get is just the result form (ORDER NR2).
Thank you.
@Anonymous
You may use DAX below to add a calculated column.
Column =
MINX (
FILTER ( 'Table', 'Table'[ID] = EARLIER ( 'Table'[ID] ) ),
'Table'[ORDER]
)
@v-chuncz-msft Hi and thank you for your answer, it works great if we have at all in the same table as a column. But how could it works when we have it in separate table1 whithout a merge at ETL?
Thank you for your answer djerro123,
what I expect to do is to get just one order number.
ID ORDER NR (ORDER NR2)
121212 1 1
121212 2 1
121212 3 1
121200 1 1
121201 2 2
121212 4 1
131313 3 3
131313 4 3
141414 2 2
141414 3 2
What I supose to get is just the result form (ORDER NR2).
Thank you.
What I expect to do is to get just one order number, the lowest filtered.
ID ORDER NR (ORDER NR by the Lowest Value)
121212 1 1
121212 2 1
121212 3 1
121200 1 1
121201 2 2
121212 4 1
131313 3 3
131313 4 3
141414 2 2
141414 3 2
Table result:
121212 1
121200 1
121201 2
131313 3
141414 2
Thank you.
Thank you for your answer djerro123,
what I expect to do is to get just one order number.
ID ORDER NR (ORDER NR2)
121212 1 1
121212 2 1
121212 3 1
121200 1 1
121201 2 2
121212 4 1
131313 3 3
131313 4 3
141414 2 2
141414 3 2
What I supose to get is just the result form (ORDER NR2).
Thank you.
Thank you for your answer djerro123,
what I expect to do is to get just one order number.
ID ORDER NR (ORDER NR2)
121212 1 1
121212 2 1
121212 3 1
121200 1 1
121201 2 2
121212 4 1
131313 3 3
131313 4 3
141414 2 2
141414 3 2
What I supose to get is just the result form (ORDER NR2).
Thank you.
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 |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |