Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
@Anonymous , 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.
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."
),
" "
)
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as 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 C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Anonymous yes, I think there was a missing bracket near the end, though I also removed some of the extra brackets that were unnecessary
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as 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 C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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."
),
" "
)
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as 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 C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@AllisonKennedy
Thanks for the help and providing such a great resource(DAX Formatter). I think I was missing a bracket, right?
Stay Awesome.
@Anonymous , 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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
98 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |