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
AliceW
Impactful Individual
Impactful Individual

If a date is in current quarter, then something, else, something else; help

Hi guys,

I'm stuck. Please help out.

So, I'm having a dataset, with Opportunities and their Close Dates, Amount Non-Weighted, and Amount Weighted.

I'd like to have a formula in a column saying: if Close Date is in the CURRENT QUARTER, then Amount Non-Weighted, else Amount Weighted.

Thank you so much.

Alice

1 ACCEPTED SOLUTION
Gordonlilj
Solution Sage
Solution Sage

Hi,

 

Try creating a calculated column like something below and see if it helps

CalcColumn = 

IF( YEAR( 'Table'[Close Date] ) & QUARTER( 'Table'[Close Date] ) = YEAR( TODAY() ) & QUARTER( Today() ),
'Table'[Amount Non-Weighted],'Table'[Amount Weighted] )

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hey @AliceW ,

 

I would use an if like in a calculated column like:

 

if = if(quarter([Date])=Quarter([Now())," Amount Non-Weighted","Amount Weighted")

 

Let me know if it helped, if so mark as solution.

 

Best Regards,

Duarte Raminhos

AliceW
Impactful Individual
Impactful Individual

Hi Duarte,

I can't seem to find QUARTER in the function list.

Gordonlilj
Solution Sage
Solution Sage

Hi,

 

Try creating a calculated column like something below and see if it helps

CalcColumn = 

IF( YEAR( 'Table'[Close Date] ) & QUARTER( 'Table'[Close Date] ) = YEAR( TODAY() ) & QUARTER( Today() ),
'Table'[Amount Non-Weighted],'Table'[Amount Weighted] )

 

AliceW
Impactful Individual
Impactful Individual

Hi Gordon,

Based on your suggestion, I figured it out. for some reason, QUARTER is not available in my list of functions, but I did use FORMAT(TODAY(),"Q").

Thank you!

Alice

Good to hear that you solved it.

The quarter function came with the 2019 december update so perhaps you don't have the latest version

 

AliceW
Impactful Individual
Impactful Individual

They have finally added the Quarter function? Hourray! I'll download it now - you were right, I did not have it.

Thanks again, Gordon!

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.