Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello I´m trying to use the following formula to get the payback, but when I got a problem when I use it, can you help me?
The 'pruebas economicValues_global'[FLUJOCAJA ACUMULADO] is a measure what can i do?
Hi @OscarSuarez10 , @AlB ,
Is the issue that DISTINCT returns a one-column table that contains the distinct values from the specified column. In other words, duplicate values are removed and only unique values are returned. Maybe DISTINCTCOUNT ?
Nathaniel
Proud to be a Super User!
Hello @Nathaniel_C I changed it to DISTINTCOUNT and i got the following mistake:
column 'FLUCAJA ACUMULADO' in table 'pruebas economicValues_global' cannot be found or may not be used in this expression.
And it´s because 'FLUCAJA ACUMULADO' is not a column is a Measure, what can i do?
@OscarSuarez10 , So tell us what you are trying to do in Numerator. BTW if you use a measure, you don't reference the table.
Nathaniel
Proud to be a Super User!
@Nathaniel_C I´m trying to get the absolute value of the last negative accumulated cash flow
You cannot use DISTINCT() or DISTINCTCOUNT( ) on a measure. Both take columns as arguments. It's best practice to not use the name table with measures, i.e., you should just use
[FLUJOCAJA ACUMULADO] instead of
'pruebas economicValues_global'[FLUJOCAJA ACUMULADO]
so that measures can be told apart from columns straight away.
You'd need to show the code for the measure [FLUJOCAJA ACUMULADO]. I believe we worked on this in another post a couple of days ago and it was solved at the time? And not with that measure. What has changed?
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
@AlB Im using this formula to calculate the cumulative cash flow:
and i get the same values that i´m trying to add when I use it as a column, but when I use the same formula as a measure it works as you can see in the following table:
cumulative cash flow: as a column
flujocaja acumulado: as a measure
You might to change
VAR Numerator_ = CALCULATE(DISTINCT(Table1[ACCUMULATED CASH FLOW]);Table1[YEAR] = Year_)
to
VAR Numerator_ = CALCULATE(DISTINCT(Table1[ACCUMULATED CASH FLOW]); FILTER( ALL(Table1[YEAR]),Table1[YEAR] = Year_) )
The names are a bit different but you get the idea.
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hello @AlB thanks for your help, I changed the script but I got the same mistake again:
A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
User | Count |
---|---|
47 | |
27 | |
23 | |
18 | |
15 |
User | Count |
---|---|
55 | |
34 | |
18 | |
17 | |
15 |