Forum Discussion
Multiplying 3 columns
Hello Shilp1rin-gue ,
I am not sure on which column you have created the relationship, hence the following solution is without relationship
You may try this:
For Calculated Column
Calc =
IF (
dtQty[DeviseRèg] <> "MAD",
dtQty[Price] * dtQty[Quantity]
* LOOKUPVALUE ( fxRate[exchangerate], fxRate[currency], dtQty[DeviseRèg] ),
dtQty[Price] * dtQty[Quantity]
)
For Measure:
Calc M =
VAR _Calc_MAD =
SUMX (
FILTER ( dtQty, dtQty[DeviseRèg] = "MAD" ),
dtQty[Price] * dtQty[Quantity]
)
VAR _Calc =
SUMX (
FILTER ( dtQty, dtQty[DeviseRèg] <> "MAD" ),
dtQty[Price] * dtQty[Quantity]
* LOOKUPVALUE ( fxRate[exchangerate], fxRate[currency], dtQty[DeviseRèg] )
)
VAR _Return =
IF (
HASONEVALUE ( dtQty[Ident] ),
IF ( SELECTEDVALUE ( dtQty[DeviseRèg] ) = "MAD", _Calc_MAD, _Calc )
)
RETURN
_Return
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂 (Hit the thumbs up button!)
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)
https://www.vivran.in/
Connect on LinkedIn
Follow on Twitter
- Shilp1rin-gue6 years agoFrequent Visitor
thank you for your reply, i related them with ident 1..* , 1 from EXCHANGE TABLE to * TRANSACTIONS ,
for the column expression, you show me it gave
"A table of multiple values was supplied where a single value was expected" :don't know why I think because I have many rows or the expression must be changed actually I'm a beginner I'm still confused
and the measure it gave nothing
- vivran226 years agoCommunity Champion
Can you share more sample data to get a better understanding?
Cheers!
Vivek
Visit my blog:
vivran.in/my-blog
Feel free to email me for any BI needs .
Connect on LinkedIn
Follow on Twitter- Shilp1rin-gue6 years agoFrequent Visitor