Forum Discussion
Calculated Column/Measure DAX
Hi Anonymous - I see this issue has been out there for a while. If you are still looking for assistance, here are some things to consider
1) Nothing wrong with making the who calculation a measure. Measures can be calculated at the row level. You just have to watch out if they are non-additive measures (where for example the value for a month is not the sum of the value for all of the days in the month).
2) SWITCH() would work better in your case than all of those nested IFs
SWITCH( TRUE(), //TRUE() here is just a placeholder
Condition1, Calculation1,
Condition2, Calculation2,
...,
ConditionN, CalculationN,
ELSE)
3) It looks like you're handling the parameters correctly. Also instead of min/max you could consider having two fields from two different tables and you can use SELECTEDVALUE() for each.
It should also be noted that this PBIX appears to be optimized for Power BI Report Server (at least that was the message I got when I opened it up), and there are a couple of functions that don't exist on regular PBI Desktop, so it would be difficult for me to put the entire code together.
Let me know if any of this helps you.
David