Forum Discussion
Formula evaluation in the row before the summary
Hello
I would like to calculate a measure based on column and input data of what-if-Parameter. In my case, I have a What-If-Parameter"Financial Cap"and another"Base Value". In addition, I have a table with two columns, ID and Relevant Compensation.
In Excel, I would do something like this, but I can't replicate it to Power BI:
- Add a new column
- Add formula IF((Relevant compensation * 0.5 + Base value)>Financial limit, Financialcapitalization,(Relevant compensation * 0.5 + Base value))
- Summarize the new column
As far as I know, calculated columns cannot work with What-If-Parameters. However, a measure itself cannot make this row-based assessment before summarizing it, at least not as far as I know. Do you have any suggestions on how to solve this? I've tried several features, but I'm not getting anywhere.
- Anonymous6 years ago
I seem to have posted the question twice. The answer that worked for me can be found here: https://community.powerbi.com/t5/Desktop/Row-wise-evaluation-of-formula-before-summarization/m-p/1061644/highlight/true#M495936
4 Replies
- parry2k
Super User
Anonymous Post sample data and expected output, it will help to provide the solution.
- Greg_Deckler
Community Champion
Sure you can do that with a measure:
Measure =
VAR __Table =
ADDCOLUMNS(
'Table',
"New Column",IF((Relevant compensation * 0.5 + Base value)>Financial limit, Financialcapitalization,(Relevant compensation * 0.5 + Base value))
)
RETURN
SUMX(__Table,[New Column])
- v-lionel-msft
Community Support
Hi Anonymous ,
Has your problem been solved? If yes, please consider Accept it as the solution to help the other members find it more quickly.
Best regards,
Lionel Chen- AnonymousNot applicable
I seem to have posted the question twice. The answer that worked for me can be found here: https://community.powerbi.com/t5/Desktop/Row-wise-evaluation-of-formula-before-summarization/m-p/1061644/highlight/true#M495936