Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Current Quarter,Last Quater,Next Quarter Text is not displaying

Hi All,

i'm try to display Current Quarter,Last Quater,Next Quarter Text in table but it is not displaying could please suggest,

Cal Year/Qtr = IF(FC[Cal year/Quarter] = FORMAT(TODAY(),"yyyy q"),"Current Quarter", IF(FC[Cal year/Quarter] = FORMAT(EOMONTH(TODAY(),-1),"yyyy q"),"Last Quarter", IF(FC[Cal year/Quarter] = FORMAT(EOMONTH(TODAY(),+1),"yyyy q"),"Next Quarter", IF(FC[Cal year/Quarter] = "Not assigned",FC[Cal year/Quarter],RIGHT(FC[Cal year/Quarter],4)+""+LEFT(FC[Cal year/Quarter],2)))))
Mahamood218_0-1642820077725.png

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to the error message, the formula returns two different types of values. It's not supported for a single column to have different types of values in Power BI.

The first three if conditions return text-type data, but in the last if condition you are using “+”. You should use "&" to concatenate text instead of "+".

 

Cal Year/Qtr = IF(FC[Cal year/Quarter] = FORMAT(TODAY(),"yyyy q"),"Current Quarter", IF(FC[Cal year/Quarter] = FORMAT(EOMONTH(TODAY(),-1),"yyyy q"),"Last Quarter", IF(FC[Cal year/Quarter] = FORMAT(EOMONTH(TODAY(),+1),"yyyy q"),"Next Quarter", IF(FC[Cal year/Quarter] = "Not assigned",FC[Cal year/Quarter],RIGHT(FC[Cal year/Quarter],4)&""&LEFT(FC[Cal year/Quarter],2)))))

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to the error message, the formula returns two different types of values. It's not supported for a single column to have different types of values in Power BI.

The first three if conditions return text-type data, but in the last if condition you are using “+”. You should use "&" to concatenate text instead of "+".

 

Cal Year/Qtr = IF(FC[Cal year/Quarter] = FORMAT(TODAY(),"yyyy q"),"Current Quarter", IF(FC[Cal year/Quarter] = FORMAT(EOMONTH(TODAY(),-1),"yyyy q"),"Last Quarter", IF(FC[Cal year/Quarter] = FORMAT(EOMONTH(TODAY(),+1),"yyyy q"),"Next Quarter", IF(FC[Cal year/Quarter] = "Not assigned",FC[Cal year/Quarter],RIGHT(FC[Cal year/Quarter],4)&""&LEFT(FC[Cal year/Quarter],2)))))

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
ALLUREAN
Solution Sage
Solution Sage

Hi, @Anonymous 

 

Since I don't take a look into your data structure, can you try the below example, if not working please provide more info.

 

Cal Year/Qtr =
VAR CalYearQ = FC[Cal year/Quarter]
VAR CurrQ = FORMAT(TODAY(),"yyyy q")
VAR LastQ = FORMAT(EOMONTH(TODAY(),-1),"yyyy q")
CAR NextQ = FORMAT(EOMONTH(TODAY(),+1),"yyyy q")


SWITCH(TRUE(),

CalYearQ = CurrQ, "Current Quarter",
CalYearQ = LastQ, "Last Quarter",
CalYearQ = NextQ, "Next Quarter",
CalYearQ = Not assigned", CalYearQ,
RIGHT(CalYearQ,4)+""+LEFT(CalYearQ,2)))))

 




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.