Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Guys!
I need to use different relationships within the same iterative function.
What I need is the below calculation, however where the all('Invoice Line');all('Purchase Order') only is applied to [Finished demand per bag]
Another attempt was made, what is weird is that the filtercontext added in the variable is removed when used in the return. All measures work like intended when used seperately.
TEST CM Total Cost Sold Bags =
var Finished_demand_per_bag = calculate(sumx(mainReseptitSQL;mainReseptitSQL[Finished demand per bag]);all('Invoice Line');all('Purchase Order'))
return
sumx(mainReseptitSQL;Finished_demand_per_bag *([CM Kg price after reduced]/[CM Yield])*[CM Sold No of Bags])
I tried making a measure of the first
[Finished demand per bag]
So it went like this
CM Finished demand per bag = calculate(sumX(mainReseptitSQL;mainReseptitSQL[Finished demand per bag]);all('Purchase Order');all('Invoice Line'))
Then I nested it so it looked like this.
TEST CM Total Cost Sold Bags = calculate(sumx(mainReseptitSQL;mainReseptitSQL[CM Finished demand per bag]*([CM Kg price after reduced]/[cm Yield])*[CM Sold No of Bags]))
Each individual measure gives me a the expected value. However, when I put them all in the same measure I get unexpected results as if the first filter context in the first measure wasn't there.
User | Count |
---|---|
73 | |
70 | |
38 | |
23 | |
23 |
User | Count |
---|---|
96 | |
94 | |
50 | |
42 | |
40 |