Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
103 | |
102 | |
87 | |
73 | |
67 |
User | Count |
---|---|
119 | |
111 | |
95 | |
79 | |
72 |