Forum Discussion
IF Statement plus Multiplication using static number
- Anonymous3 years ago
I found the answer here -> https://www.enjoysharepoint.com/power-bi-measure-multiply/ (Power BI Measure multiply by 100).
_GA Income Calcs = IF(SELECTEDVALUE('Single Donations'[GiftAid]) = "Yes", CALCULATE(SELECTEDVALUE('Single Donations'[amount]) * 0.25, FILTER('Single Donations', 'Single Donations'[GiftAid] = "Yes")), 0)Thank you so much for all your help with this, pratyashasamal .
Try this once,
This will work only from the Y2 column (GiftAid) column datatype is text and it also has a value of Yes in it . Exact function will match the Y2 column with Yes text and return a True / false column .
Measure = IF(Exact('Table'[Y2],"Yes"),CALCULATE(SUM('Table'[AL2])*0.25),0)
Sorry, also didn't work. After the "Exact", it doesn't allow me to chose a table.
GiftAid column is Text
Amount column is Decimal number.
- pratyashasamal3 years agoMemorable Member
Measure = IF('Table'[Y2] == "Yes",CALCULATE(SUM('Table'[AL2])*0.25),0) - Anonymous3 years agoNot applicable
Again, it doesn't allow me to select a table, only the other measures I have.
Would any screen shot help? Not sure of what to be honest hehe I think the issue is the aggregation after the IF, isn't it?
- pratyashasamal3 years agoMemorable Member
This is ss ,
Measure 3 is where is am checking if the condition is Yes or not .
Then multiplying it with my sales value .
and Measure 2 is a simple measure with "Yes" or "No" values. - Anonymous3 years agoNot applicable
Below is an example of my data:
This is what I get when trying your latest statement:
Even if I type the table/column, still it doesn't work. Both columns ("GiftAid" and "amount") used for the calculation are from the same table. But I don't think it should matter, should it?
- pratyashasamal3 years agoMemorable Member
Please check once what is the datatype of GiftAid column and change it to text if it not a text .
- Anonymous3 years agoNot applicable
It is a Text. And it's not a measure, it's a column.