Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Dear All,
I have the following calculated column:
var SUPPLIERS = CALCULATE(SUM(Cashflow[Importo (+/-)]),Cashflow[Source]=0, Cashflow[Categoria]="FORNITORI")
var PREVISIONE_FORNITORI_CURRENT = Cashflow[Source]=5 && Cashflow[Completed_month]=0 && Cashflow[Par1]=1
var CLIENTS = CALCULATE(SUM(Cashflow[Importo (+/-)]),Cashflow[Source]=0, Cashflow[Categoria]="CLIENTI")
var PREVISIONE_CLIENTI_CURRENT = Cashflow[Source]=5 && Cashflow[Completed_month]=0 && Cashflow[Par1]=0
var PREVISIONALE_PAST = Cashflow[Source]=5 && Cashflow[Completed_month]=1
RETURN
IF( PREVISIONALE_PAST, 0, IF(PREVISIONE_FORNITORI_CURRENT, Cashflow[Importo (+/-)] - SUPPLIERS, IF(PREVISIONE_CLIENTI_CURRENT, Cashflow[Importo (+/-)] - CLIENTS, Cashflow[Importo (+/-)])))
Problem is the var in red do not works (it doesn't subtract anything).
Do you have any recommendations?
Thank you a lot
What do you want to calculate, the sum of importo when source is 0 or the category is "Fornitori"? In this case, you can try: var SUPPLIERS = CALCULATE(SUM(Cashflow[Importo (+/-)]), Cashflow[Source]=0 || Cashflow[Categoria]="FORNITORI").
Also check the type of data for both columns.
Actually I want to calculate the sum of importo when source is 0 and category is "Fornitori".
Is that a problem?
Change the "||" by "&&" operator. Anyway, your measure shouldn't be a problem.
I have checked with a simple example and it is working right
Try to check return SUPPLIERS. (Comment the two lines you have right now). If it computes the value, the problem is in your IF condition
Thanks @mlsx4
The problem is despite any operator I use, it does not subtract anything:
RETURN
IF( PREVISIONALE_PAST, 0, IF(PREVISIONE_FORNITORI_CURRENT, Cashflow[Importo (+/-)] - SUPPLIERS, IF(PREVISIONE_CLIENTI_CURRENT, Cashflow[Importo (+/-)] - CLIENTS, Cashflow[Importo (+/-)])))
Yes, but I think it is because of the if. Have you tried to return only Suppliers or Clients (without all the if)? Just as a way of checking the measure.
User | Count |
---|---|
91 | |
73 | |
68 | |
63 | |
55 |
User | Count |
---|---|
99 | |
88 | |
73 | |
60 | |
58 |