Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a field called Month and a field called Year being pulled from a dates table. The measure is using the Month Offset field in the same table, pulling the measure of something else in accordance with the Month Offset in the measure.
As time goes one, the month offset will change, for example, minus one month takes us to Feb, but next month that will take us to March. As the table is going to be accumulative, I need the field names to change accordingly. I want the field/label name to change as time goes on so the field name reflects the offset condition. My measure (using set analysis )works fine.
But this isn't working with the label.
=if([Month Offset] = 0, Concat([Month] & '-' & [Year]), 'no')
I have put 'no' as the else statement as a test, unfortunately, no is being printed as the label.
Why is this not concetating and putting the Month and Year names together where the row is 0 in the Month Offset field? Can someone fix my formula. Many thanks.
if the Month offset field has multiple values 'no' would be printed.
if are requiring the label to work calculate based on today's date, then you can try labeling using today() function.
Hi,
I am sorry if I am being daft. Can you please give me an example in how I would do this with code?
Many thanks.
in label
monthname(today()-1)
Channa has it right but I think the expression is missing a comma:
=MonthName(Today(), -1)
If the [Month Offset] is dynamic, you could just do:
=MonthName(Today(), [Month Offset] * -1)