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
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 contratante | CPF | PARCEIRO | Status Contrato | Valor 1º repasse | Data 1ª repasse | Status 1ª Repasse | Valor 2º repasse | Data 2º repasse | Status 2ª Repasse | Valor 3º repasse | Data 3º repasse | Status 3ª Repasse | Valor 4º repasse | Data 4º repasse | Status 4ª Repasse | Valor 5º repasse | Data 5º repasse | Status 5ª Repasse | Valor 6º repasse | Data 6º repasse | Status 6ª Repasse | Valor 7º repasse | Data 7º repasse | Status 7ª Repasse | Valor 8º repasse | Data 8º repasse | Status 8ª Repasse |
| TESTE A | 000.000.000-00 | XX | CONTRATO FATURADO | R$ 3,470.83 | 4/10/2019 | REALIZADO | R$ 3,470.83 | 3/20/2020 | REALIZADO | R$ 3,470.83 | 7/21/2020 | A REALIZAR | 0 | 0 | R$ - | R$ - | R$ - | ||||||||||
| TESTE B | 000.000.000-00 | XX | CONTRATO FATURADO | R$ 3,916.67 | 4/10/2019 | REALIZADO | R$ 3,916.67 | 3/20/2021 | REALIZADO | R$ 3,916.67 | 1/24/2022 | REALIZADO | 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 contratante | CPF | PARCEIRO | Status Contrato | Valor Repasse | Data Repasse | Status Repasse | Repasse |
| TESTE A | 000.000.000-00 | XX | CONTRATO FATURADO | R$ 3,470.83 | 4/10/2019 | REALIZADO | 1 |
| TESTE B | 000.000.000-00 | XX | CONTRATO FATURADO | R$ 3,916.67 | 4/10/2019 | REALIZADO | 2 |
Can I do it only with PowerBI? I realy don't know how to start it.
Many thanks.
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
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.
Hi @Anonymous ,
What do you mean "when the column Data Repasse is filled"?
Best Regards,
Jay
Up
Hi guys,
Could someone can help me please?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 33 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 41 | |
| 34 | |
| 25 |