Forum Discussion

jnsrkd's avatar
jnsrkd
Frequent Visitor
1 year ago

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:

 

ACCOUNTSTATUSVALUE ORIGIN
1.1 RECEITAACCOUNTING ENTRY
2.1 DEDUCOESACCOUNTING ENTRY
3.1 RECEITA LIQ1.1 - 2.1
4.1 CUSTOSACCOUNTING ENTRY
5.1 LUCRO OP3.1 - 4.1
6.1 DESPESASACCOUNTING ENTRY
7.1 LUCRO5.1 - 6.1
8.1. RECEITASACCOUNTING ENTRY
9.1 LUCRO FIN7.1 - 8.1
10.1 RESULTADO N OPACCOUNTING ENTRY
11.1 RESULTADO10.1 - 11.1
12.1 IRPJ E CSLLACCOUNTING ENTRY
13.1 LUCRO11.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

    • jnsrkd's avatar
      jnsrkd
      Frequent 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's avatar
        SachinNandanwar
        Icon for Impactful Individual rankImpactful 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.

  • Anonymous's avatar
    Anonymous
    Not 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?