Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Split columns into rows

Hi guys,

I am trying to create a Dax or something like this to split a columns into rows. I have this example of table:

Nome do contratanteCPFPARCEIROStatus Contrato Valor 1º repasse Data 1ª repasseStatus 1ª Repasse Valor 2º repasse Data 2º repasseStatus 2ª Repasse Valor 3º repasse Data 3º repasseStatus 3ª Repasse Valor 4º repasse Data 4º repasseStatus 4ª Repasse Valor 5º repasse Data 5º repasseStatus 5ª Repasse Valor 6º repasse Data 6º repasseStatus 6ª Repasse Valor 7º repasse Data 7º repasseStatus 7ª Repasse Valor 8º repasse Data 8º repasseStatus 8ª Repasse
TESTE A000.000.000-00XXCONTRATO FATURADO R$   3,470.834/10/2019REALIZADO R$   3,470.833/20/2020REALIZADO R$   3,470.837/21/2020A REALIZAR 0    0    R$             -     R$             -     R$             -    
TESTE B000.000.000-00XXCONTRATO FATURADO R$   3,916.674/10/2019REALIZADO R$   3,916.673/20/2021REALIZADO R$   3,916.671/24/2022REALIZADO 0    0    R$             -     R$             -     R$             -    


So, when the columns "Status Xª repasse" are filleds I need to create a new row in other table. The table that we need to create is something like this:

 

Nome do contratanteCPFPARCEIROStatus Contrato Valor Repasse Data RepasseStatus RepasseRepasse
TESTE A000.000.000-00XXCONTRATO FATURADO R$ 3,470.834/10/2019REALIZADO1
TESTE B000.000.000-00XXCONTRATO FATURADO R$ 3,916.674/10/2019REALIZADO2

 

Can I do it only with PowerBI? I realy don't know how to start it.

 

Many thanks.

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

 

You could use SELECTCOLUMNS() and UNION() functions.

https://docs.microsoft.com/en-us/dax/selectcolumns-function-dax 

https://docs.microsoft.com/en-us/dax/union-function-dax 

Table 2 = 
var Repasse1 = SELECTCOLUMNS('Table',"Nome do contratante",'Table'[Nome do contratante],"CPF",'Table'[CPF],"PARCEIRO",'Table'[PARCEIRO],"Status Contrato",'Table'[Status Contrato],"Valor Repasse",'Table'[Valor 1º repasse],"Data Repasse",'Table'[Data 1ª repasse],"Status Repasse",'Table'[Status 1ª Repasse],"Repasse",1)
var Repasse2 = SELECTCOLUMNS('Table',"Nome do contratante",'Table'[Nome do contratante],"CPF",'Table'[CPF],"PARCEIRO",'Table'[PARCEIRO],"Status Contrato",'Table'[Status Contrato],"Valor Repasse",'Table'[Valor 2º repasse],"Data Repasse",'Table'[Data 2º repasse],"Status Repasse",'Table'[Status 2ª Repasse],"Repasse",2)
var Repasse3 = SELECTCOLUMNS('Table',"Nome do contratante",'Table'[Nome do contratante],"CPF",'Table'[CPF],"PARCEIRO",'Table'[PARCEIRO],"Status Contrato",'Table'[Status Contrato],"Valor Repasse",'Table'[Valor 3º repasse],"Data Repasse",'Table'[Data 3º repasse],"Status Repasse",'Table'[Status 3ª Repasse],"Repasse",3)
Return
UNION(Repasse1,Repasse2,Repasse3)

 

Best Regards,

Jay

Anonymous
Not applicable

Hi @Anonymous,

 

Many thanks for your reply, but it's not exactly what we need. We have the first table, and we need to split into rows when the column Data Repasse is filled. 

Anonymous
Not applicable

Hi @Anonymous ,

 

What do you mean "when the column Data Repasse is filled"?

 

Best Regards,

Jay

Anonymous
Not applicable

Up

Anonymous
Not applicable

Hi guys,


Could someone can help me please?

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors