Forum Discussion
Aoi
3 years agoNew Member
Measure based on specific value
Hi, *I'm Japanese, so my English might be a bit strange. I have two table: 1. Sales data (fact) 2. Reference price (dimention) Table 1 Table 2 This table provides referenc...
v-zhangti
3 years agoCommunity Support
Hi, Aoi
You can try the following methods.
Measure =
Var _quantity=SUM(Table1[Quantity])
Var _quantity_1=CALCULATE(MAX(Table2[Applicable quantity 1]),FILTER(Table2,[Product Name]=SELECTEDVALUE(Table1[Product Name])))
Var _Price_1=CALCULATE(MAX(Table2[Reference Price 1]),FILTER(Table2,[Product Name]=SELECTEDVALUE(Table1[Product Name])))
Var _Price_2=CALCULATE(MAX(Table2[Reference Price 2]),FILTER(Table2,[Product Name]=SELECTEDVALUE(Table1[Product Name])))
Return
IF(_quantity<_quantity_1,_Price_1,IF(_quantity>_quantity_1,_Price_2))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Aoi
3 years agoNew Member
Thank you for your reply!
I tried this measure, but an error below occured...
it exceeded the resources available to the visual
It maybe becouse of my bad data modeling.
So I will review that.
Thanks a lot for your help...!