The following command works fine while adding a new column
FORMAT(EOMONTH(DATE(YEAR(NOW()),MONTH(NOW()),DAY(NOW())),-1), "MMMM-YYYY")
But when I try to use it like this
Check Empty =
IF(ISBLANK('August''2020'[LSA]),(IF(ISBLANK('August''2020'[Description of the Change]),"*For the month of "& (FORMAT(EOMONTH(DATE(YEAR(NOW()),MONTH(NOW()),DAY(NOW())),-1), "MMMM-YYYY")) & ", there were no compliant based Cos."), " "))
It displays
Operator or expression '( )' is not supported in this context.
What's happeing? And how to remove this?
Solved! Go to Solution.
@R_S-13697 , You can use date table and time intelligence
example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
last year MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
Month behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Proud to be a Super User!
You have a syntax error in it. Daxformatter.com is a great site for formatting your code:
Not sure if this is what you're looking for:
Check Empty =
IF (
ISBLANK ( 'August''2020'[LSA] ),
IF (
ISBLANK ( 'August''2020'[Description of the Change] ),
"*For the month of "
& FORMAT (
EOMONTH ( DATE ( YEAR ( NOW () ), MONTH ( NOW () ), DAY ( NOW () ) ), -1 ),
"MMMM-YYYY"
) & ", there were no compliant based Cos."
),
" "
)
Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos.
I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query.
@R_S-13697 yes, I think there was a missing bracket near the end, though I also removed some of the extra brackets that were unnecessary
Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos.
I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query.
You have a syntax error in it. Daxformatter.com is a great site for formatting your code:
Not sure if this is what you're looking for:
Check Empty =
IF (
ISBLANK ( 'August''2020'[LSA] ),
IF (
ISBLANK ( 'August''2020'[Description of the Change] ),
"*For the month of "
& FORMAT (
EOMONTH ( DATE ( YEAR ( NOW () ), MONTH ( NOW () ), DAY ( NOW () ) ), -1 ),
"MMMM-YYYY"
) & ", there were no compliant based Cos."
),
" "
)
Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos.
I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query.
@AllisonKennedy
Thanks for the help and providing such a great resource(DAX Formatter). I think I was missing a bracket, right?
Stay Awesome.
@R_S-13697 , You can use date table and time intelligence
example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
last year MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
Month behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Proud to be a Super User!
User | Count |
---|---|
461 | |
206 | |
118 | |
58 | |
58 |
User | Count |
---|---|
478 | |
260 | |
147 | |
78 | |
74 |