Forum Discussion
Need help with a DAX Measure to complete a Income Statement dashboard
Hello all,
I'm "attaching" the PBIX file and the Excel file with data (mock values) below:
Excel: Link
PBIX: Link
Although in the example above the values come from an Excel sheet, I'm actually gathering all the data from a database using SQL.
I need help with a DAX measure:
I'm trying to create a DRE (Income Statement) from an ERP system called Totvs Protheus. Most of it is complete; however, it needs a final sum of the aggregation accounts:
| ACCOUNT | STATUS | VALUE ORIGIN |
| 1.1 RECEITA | ✔ | ACCOUNTING ENTRY |
| 2.1 DEDUCOES | ✔ | ACCOUNTING ENTRY |
| 3.1 RECEITA LIQ | ✘ | 1.1 - 2.1 |
| 4.1 CUSTOS | ✔ | ACCOUNTING ENTRY |
| 5.1 LUCRO OP | ✘ | 3.1 - 4.1 |
| 6.1 DESPESAS | ✔ | ACCOUNTING ENTRY |
| 7.1 LUCRO | ✘ | 5.1 - 6.1 |
| 8.1. RECEITAS | ✔ | ACCOUNTING ENTRY |
| 9.1 LUCRO FIN | ✘ | 7.1 - 8.1 |
| 10.1 RESULTADO N OP | ✔ | ACCOUNTING ENTRY |
| 11.1 RESULTADO | ✘ | 10.1 - 11.1 |
| 12.1 IRPJ E CSLL | ✔ | ACCOUNTING ENTRY |
| 13.1 LUCRO | ✘ | 11.1 - 12.1 |
The table above shows what I already have figured it out (✔), and what is missing (✘)
Thefore, what I have is:
The accounts jump from 1.1 and 2.1 to 4.1, the 3.1 doesn't appear.
And what I must achieve is:
In this example, some of the dimension table data came from Excel, which made it possible to set the group accounts. Also note that:
3 RECEITA OPERACIONAL LIQUIDA = 1. VENDA DE PRODUTOS - 2 DEDUCOES E ABATIMENTOS
My company doesn't want to use any Excel files in the dashboard; therefore, all information must come from the data I provided (which comes from the Database/ERP).
The logic to sum the missing parts is in the table "Visao Formula" I provided, with the following relationship:
'Visao Formula'[Formula] - 'Visao Sintetica'[Entid_Gerenc]
And the aggregation accounts (3.1, 5.1, 7.1, 9.1, 11.1, 13.1) must be in between the remaining accounts.
If someone could please help, I think I'm already a month stuck with this Dashboard with no idea how to actually complete.
Thank you very much!
6 Replies
- SachinNandanwar
Impactful Individual
- jnsrkdFrequent Visitor
From what I can gather, the gif is explaining that the relationships don't allow the values from Dados to appear?
I'm sorry, I don't think I understood what you are trying to say
- SachinNandanwar
Impactful Individual
Yes thats correct, because in your original question you mentioned that: "The accounts jump from 1.1 and 2.1 to 4.1, the 3.1 doesn't appear."
So the GIF was just trying to show why it isnt appearing.
- AnonymousNot applicable
Bom dia! Tudo bem?
Eu vi seu post e estou tentando fazer integração do DataSul com o Power BI, gostaria de saber se foi isso que você fez. Caso sim, poderia me ajudar? - FBergamaschi
Super User
If you can provide a pbix I can fix it