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.
Hi,
I have a table called factVentas with lots of data, I need a dynamic report of paretto 80 20 by dates. The issue is that I have an error in making an accumulated sum within a measure.
Something like this.
where $SumValue and $Total1 are measured with the following formulas:
$SumValue = SUM (factVentas[VENTA NETA] )
$Total1 = SUMX(ALLSELECTED(factVentas), factVentas[VENTA NETA])
Now, what is needed is to accumulate the value of $SumValue row by row, and I do it in the following way:
$VentasAcumuladas = SUMX(FILTER(factVentas, EARLIER(factVentas[$SumValue],1)<=factVentas[$SumValue]),factVentas[$SumValue])
The error says: EARLIER/EARLIEST refers to an earlier row context which doesn't exist.
This formula works well on a column, but I have this error as a measure. Any help in this case would be greatly appreciated. Greetings.
Solved! Go to Solution.
Hi @Jorge1986,
EARLIER/EARLIEST function can be used in calculated column only , but not supported within a measure.
In your scenario, please first create a calculated column in 'facyVentas':
Rank col = RANKX ( ALL ( factVentas ), CALCULATE ( SUM ( factVentas[VENTA NETA] ), ALLEXCEPT ( factVentas, factVentas[Category] ) ), , DESC, DENSE )
Then, create a measure to return accumulated sum:
$VentasAcumuladas = CALCULATE ( SUM ( factVentas[VENTA NETA] ), FILTER ( ALL ( factVentas ), factVentas[Rank col] <= MAX ( factVentas[Rank col] ) ) )
Best regards,
Yuliana Gu
Hi @Jorge1986,
EARLIER/EARLIEST function can be used in calculated column only , but not supported within a measure.
In your scenario, please first create a calculated column in 'facyVentas':
Rank col = RANKX ( ALL ( factVentas ), CALCULATE ( SUM ( factVentas[VENTA NETA] ), ALLEXCEPT ( factVentas, factVentas[Category] ) ), , DESC, DENSE )
Then, create a measure to return accumulated sum:
$VentasAcumuladas = CALCULATE ( SUM ( factVentas[VENTA NETA] ), FILTER ( ALL ( factVentas ), factVentas[Rank col] <= MAX ( factVentas[Rank col] ) ) )
Best regards,
Yuliana Gu
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 |
---|---|
111 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |