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,
That worked to show me the last purchase value of each product, but when multiplying it in the form:
[sales] * [purchase value]
Totals are multiplied because the calculation is not being done row by row.
But doing it with SUMX in the way:
SUMX ('table', [sales] * [purchase value])
The result is blank again as if [purchase value] was not looking up the values in all warehouses.
You could use ALL ('table' [warehouse]) like this:
CALCULATE (SUMX ('table', [sales] * [purchase value]), ALL ('table' [warehouse]))
But I'm interested in the sales being filtered through the selected warehouse.
So I wonder if there is a way that the [purchase value] is related to all the warehouse or if someone else comes up with another solution.
Solved! Go to Solution.
@FrancoIVM , if they are from the same table calculation should be done at the row-level
you can get a price like
[Purchase value] = CALCULATE(
LASTNONBLANKVALUE('table'[date],
SUM('table'[values])),
filter('table' , 'table'[warehouse] = earlier('table'[warehouse])))
or
[Purchase value] = CALCULATE(
LASTNONBLANKVALUE('table'[date],
SUM('table'[values])),
filter('table' , 'table'[item] = earlier('table'[item])))
or have the level to use values
CALCULATE (SUMX (values('table'[?]), [sales] * [purchase value]), ALL ('table' [warehouse]))
@FrancoIVM , if they are from the same table calculation should be done at the row-level
you can get a price like
[Purchase value] = CALCULATE(
LASTNONBLANKVALUE('table'[date],
SUM('table'[values])),
filter('table' , 'table'[warehouse] = earlier('table'[warehouse])))
or
[Purchase value] = CALCULATE(
LASTNONBLANKVALUE('table'[date],
SUM('table'[values])),
filter('table' , 'table'[item] = earlier('table'[item])))
or have the level to use values
CALCULATE (SUMX (values('table'[?]), [sales] * [purchase value]), ALL ('table' [warehouse]))
Thanks you,
The last alternative works for me,
CALCULATE (SUMX (values('table'[?]), [sales] * [purchase value]), ALL ('table' [warehouse]))
The ALL ('table' [warehouse]) was'nt necessary, when i used the Vale(table[items]) instead the table, the filters works fine.
I was a lot of time on this, so really ty!
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 |
---|---|
113 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |