Forum Discussion
Anonymous
3 years agoNot applicable
Matrix Visual - creating a measure with IF statement
Hi all! I am back with more questions. This time, I want to ask whether it is possible to a make possible to incorporate an IF statement when creating a measure. Suppose I have the follow...
- 3 years ago
Hi Anonymous
Try this (modify values as you need):
Measure = var _column= SELECTEDVALUE(Sheet1[Obligation Type]) var _suma= SUM(Sheet1[Set-off / payment amount]) return SWITCH(_column, "VAT", (_suma)*0.25, "WHT 23",(_suma)*0.3, "WHT 21", (_suma)*0.21, "WHT 4(2)", (_suma)*0.x, _suma)
Anonymous
3 years agoNot applicable
In addition to my reply above,
I tried putting in the code you shared. However it seems that the code is not working.
It seems like the formula only work only for measure fields?
Here is my list of fields for your reference:
mlsx4
3 years agoMemorable Member
Hi again, Anonymous
Can you try to use something like:
Can you try to use something like:
var _column= SELECTEDVALUE(Sheet1[Obligation Type])
return
SWITCH(_column,...)
- Anonymous3 years agoNot applicable
Hi!
Can use something like this?
Switch1 = SWITCH(SELECTEDVALUE(Sheet1[Obligation type]),"VAT",SELECTEDVALUE(Sheet1[Set-off / payment amount])*0.2,"WHT 21",SELECTEDVALUE(Sheet1[Set-off / payment amount])*0.35,"WHT 23",SELECTEDVALUE(Sheet1[Set-off / payment amount])*0.4,"WHT 4(2)",SELECTEDVALUE(Sheet1[Set-off / payment amount])*0.1)- mlsx43 years agoMemorable Member
Mmmm... it may not work...
Can you provide a sample of data? I cannot figure out how can you calculate it without knowing the structure
- Anonymous3 years agoNot applicable
I uploaded the dummy file to dropbox for your reference: https://www.dropbox.com/scl/fi/5jngy5sj8wsd86mqcdsrj/Dummy-Data-for-Report.xlsx?rlkey=wlztk97eexhr2iw3f83otyjfv&dl=0