Forum Discussion
Smart Narrative Error: Couldn't Load Data for this Visual
- Anonymous5 years ago
I needed a previous month as text in the format of Month Year like April 2021...
I had a formula that was working using value in visuals but not in text box as a value.
After trying a few formulas and researching and came up with this and it dynamic value no longer gives me an error that multiple results were given when a single value was expected:
Last Month Alt =VAR test1 = LOOKUPVALUE('Date'[MonthInCalendar],'Date'[Date],DATEADD(ENDOFMONTH('Date'[Date]),-1,MONTH))Returntest1Closing this post.
Hi Anonymous ,
Use the below measure:
Last Month =
VAR test1 =
CALCULATE (
VALUES ( 'Date1'[MonthInCalendar] ),
FILTER (
ALL ( date1 ),
MAX ( date1[Date] ) = DATEADD ( date1[Date], 1, MONTH )
)
)
RETURN
IF ( test1 = BLANK (), 12, test1 )
Wish it is helpful for you!
Best Regards
Lucien
- Anonymous5 years agoNot applicable
I needed a previous month as text in the format of Month Year like April 2021...
I had a formula that was working using value in visuals but not in text box as a value.
After trying a few formulas and researching and came up with this and it dynamic value no longer gives me an error that multiple results were given when a single value was expected:
Last Month Alt =VAR test1 = LOOKUPVALUE('Date'[MonthInCalendar],'Date'[Date],DATEADD(ENDOFMONTH('Date'[Date]),-1,MONTH))Returntest1Closing this post.