Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi guys,
I have a table like the one on the left. I want to transform this table into the one on the right. Is it possible with Power Query or SQL? If so, how can I do it?
Solved! Go to Solution.
Hi @Anonymous
Do you want to have a seperate table???
Like this??
then take new table from modeling tab then write this
I hope I answered your question!
Hi @Anonymous ,
If the first and last are determined by the [Score] field, try creating a calculated table with the following code:
Table2 =
SUMMARIZE(
'Table',
'Table'[ID],
"first_CVN",
VAR __min_score = CALCULATE( MIN('Table'[Score]), ALLEXCEPT('Table','Table'[ID]) )
VAR __result = CALCULATE(MAX('Table'[Cvn]),'Table'[Score]=__min_score,ALLEXCEPT('Table','Table'[ID]))
RETURN
__result,
"last_CVN",
VAR __max_score = CALCULATE( MAX('Table'[Score]), ALLEXCEPT('Table','Table'[ID]) )
VAR __result = CALCULATE(MAX('Table'[Cvn]),'Table'[Score]=__max_score,ALLEXCEPT('Table','Table'[ID]))
RETURN
__result
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi @Anonymous ,
If the first and last are determined by the [Score] field, try creating a calculated table with the following code:
Table2 =
SUMMARIZE(
'Table',
'Table'[ID],
"first_CVN",
VAR __min_score = CALCULATE( MIN('Table'[Score]), ALLEXCEPT('Table','Table'[ID]) )
VAR __result = CALCULATE(MAX('Table'[Cvn]),'Table'[Score]=__min_score,ALLEXCEPT('Table','Table'[ID]))
RETURN
__result,
"last_CVN",
VAR __max_score = CALCULATE( MAX('Table'[Score]), ALLEXCEPT('Table','Table'[ID]) )
VAR __result = CALCULATE(MAX('Table'[Cvn]),'Table'[Score]=__max_score,ALLEXCEPT('Table','Table'[ID]))
RETURN
__result
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
hi @Anonymous
just simply take matrix visual and add two times cvn and set to first and last
I hope I naswered your question!
I was planning to create a relationship table with a matrix table, but I couldn't do it with matrix table
Hi @Anonymous
I didnt understand you query..
Relationship table with Matrix table???
That's my bad, sorry. The left table is already inserted into my report. I want to create two new columns called first_cvn and last_cvn. The first_cvn value should come from the minimum score, and the last_cvn value should come from the highest score. I am going to use this table as a join table; due to this reason, I couldn't use image solutions. 😞
Hi @Anonymous
If you want to create relationship then you need to have calculated column.
try below dax
I hope this may resolved your issue!
Hi @Anonymous
Do you want to have a seperate table???
Like this??
then take new table from modeling tab then write this
I hope I answered your question!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
70 | |
55 | |
37 | |
31 |
User | Count |
---|---|
83 | |
64 | |
63 | |
49 | |
45 |