Forum Discussion
Help with adding if then statement?
- 1 year ago
Can you provide a sample of the data please? It may be better to use a calculated column that only performs the if statement, depending on how your data is presented
Here i've used the column
CalculatedColumn = IF('January2025Hours'[Hours] < 1, 1, 'January2025Hours'[Hours])to obtain the following results
Let me know if this fixes the issue, thanks
Agree with Wardy 912.
Just for another angle on this same solution, you would probably have a measure for your SUM of EHR hours anyway, (same as the Variable created above and so you can use it elsewhere), so you can then write the same IF statement using that measure in the same way as the variable is used above. Just another way of looking at it.
Thanks for the input! I wasn't sure if I could reference measures in measures.
- mfed1 year agoFrequent Visitor
Yes, for sure - in fact in my training it was best practice to create a 'Measure Table' with as many measures as you thought you might need, then you can reference them on their own or in other measures. It's a standalone table in the data model with all your individual measures, and once you have that it sits right at the top of your 'Data' section on your main screen.
- SPDA1 year agoRegular Visitor
Nice, I'll add that to my practice. Appreciate the tip!