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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.