Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi Team,
I need to create a measure based on the client code. If the client code is A, then meausre=divide (sum(Table1[Charge] of A) , sum(Table2[Units] of A)). Can I please know how to achieve this requirement?
Thanks
DA
Solved! Go to Solution.
Your not giving a lot of context here, but should be something similiar to the following...
MyMeasure=
VAR chargeValue = SUMX(FILTER(ALLSELECTED(Table1),Table1[Charge] = "A"), FieldToBeSum)
VAR UnitValue = SUMX(FILTER(ALLSELECTED(Table2),Table2[Units] = "A"), FieldToBeSum)
RETURN DIVIDE(chargeValue ,UnitValue ,0)
Thanks @BrianConnelly Is there any other way to achieve this if the value of A is dynamic?
If you have a slicer to choose the dynamic value then add another variable...
MyMeasure=
VAR dynamicValue = SELECTEDVALUE(DyanmicFieldName, DefaultValue(e.g. "A"))
VAR chargeValue = SUMX(FILTER(ALLSELECTED(Table1),Table1[Charge] = dynamicValue ), FieldToBeSum)
VAR UnitValue = SUMX(FILTER(ALLSELECTED(Table2),Table2[Units] = dynamicValue ), FieldToBeSum)
RETURN DIVIDE(chargeValue ,UnitValue ,0)
Your not giving a lot of context here, but should be something similiar to the following...
MyMeasure=
VAR chargeValue = SUMX(FILTER(ALLSELECTED(Table1),Table1[Charge] = "A"), FieldToBeSum)
VAR UnitValue = SUMX(FILTER(ALLSELECTED(Table2),Table2[Units] = "A"), FieldToBeSum)
RETURN DIVIDE(chargeValue ,UnitValue ,0)
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
10 |