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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
heitorchehad
Frequent Visitor

Cashflow result in next month, with multiples relationships

Hello!

I would like a help, I have several queries that bring me the information via SQL, they are all related to a table of FINANCIAL CATEGORY.

I have the Reconcilable Bank Balances to date today, next month, when there is no value in the Balances table, I want the flow to return the result of the previous month.

Something similar to this formula, which does not work because of the relation of the tables, which return only where there are values ​​filled in the financial category.

TEST MEASURE = var resultPrevious = SUMX ('Movement Categories'; CALCULATE ([Result Flow]; PREVIOUSMONTH (Dale)
var Previous Balance = SUMX ('BANK AND ACCOUNT'; CALCULATE ([Previous Balance]; PREVIOUSDAY (FIRSTDATE (DCalendario [Date]))))
var Input = CALCULATE (sum (INPUTS [Value Dep])) + [Trans. Entry] + [Accounts Receivable]
var Output = CALCULATE (sum ('OUTPUTS' [TotalLiq_des])) - [Trans. Exit] - [Accounts Payable]
return
IF (HASONEVALUE ('Movement Categories' [CMF]);
SWITCH (VALUES ('Movement Categories' [CMF]);
"BANK BALANCE"; IF (FIRSTDATE [Date]) <TODAY (); Previous Balance; resultPrevious+input-ouput);
[Flow Result]))

 

 

Capture.PNGtempsnip.png

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@heitorchehad,

 

You may try CROSSFILTER Function outside and set cross-filter direction to None.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft


I'm thankful for your help, but doesnt work.
The tables: Inputs, Outputs, Receivables, Payments, Bank Account, Bank Transfers (In and Out) have values, and that querys is in relationship with my FINANCIALS CATEGORYs.


I need the cashflow result of previousmonth will be inputed on the line of 'Saldo Bancário Atual', so, when i use the measures for calculate the result and put them in the line, they don't bring me nothing, because don't have any values in this specific line.

 

I'm thinking in do a SUMMARIZE to calculate that result in a another table, so when i do that i got other problemas, with my filters of report, in that SUMMARIZE i cant do the filters for my companies.

 

Maybe a SUMMARIZE of each table? I dont think this is a good idea..

In theory i need basicly that:

MEDIDA TESTE = VAR RESULTADOANTERIOR = SUMX('CATEGORIAS DE MOVIMENTACAO';CALCULATE([RESULTADO FLUXO];PREVIOUSMONTH(DCALENDARIO[DATE])))
                VAR SALDOANTERIOR = SUMX('BANCO E CONTA'; CALCULATE([SALDO ANTERIOR];PREVIOUSDAY(FIRSTDATE(DCALENDARIO[DATE]))))
                VAR ENTRADA = CALCULATE(SUM(ENTRADAS[VALOR DEP]))+[TRANSF. ENTRADA]+[CONTAS A RECEBER]
                VAR SAIDA = CALCULATE(SUM('SAÍDAS'[TOTALLIQ_DES]))-[TRANSF. SAIDA]-[CONTAS A PAGAR]       
                        RETURN
                       IF(HASONEVALUE('CATEGORIAS DE MOVIMENTACAO'[CMF]);
                            SWITCH(VALUES('CATEGORIAS DE MOVIMENTACAO'[CMF]);
                                    "SALDO BANCÁRIO"; IF(FIRSTDATE(DCALENDARIO[DATE])<TODAY();SALDOANTERIOR;RESULTADOANTERIOR+ENTRADA-SAIDA);
                                    
                                   [RESULTADO FLUXO]))

heitorchehad
Frequent Visitor

Anyone could help me?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.