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
Junaid11
Helper V
Helper V

Count based on Current quarter and Next Quarter

Hello,
I have thre columns as shown in table below. I want to count the status column. Open status should be done based on due date column while closed status should be done on closed date column. I want to count the open and close for current quarter and next quarter which will come after this quarter. 

StatusDue DateClosed Date
Open23/2/202312/1/2023
Close11/2/20233/1/2023
Open12/4/202318/3/2023
Close20/6/20232/6/2023
Open19/1/20234/1/2023
Open25/6/20235/5/2023
Close7/9/202327/8/23
Open17/9/202317/9/2023

It should not count next quarter for all the next coming quarter but for the single next quarter. My outcome will look like below as per above data. 

StatusCurrent QuarterNext Quarter
Open22
Close12

Your help would be highly appreciated.
Thank you

5 REPLIES 5
Rudy_D
Resolver I
Resolver I

Hey !

 

Please try this 🙂 :

 

Current Quarter = QUARTER(TODAY())
Quarter Due Date = QUARTER(SELECTEDVALUE(Table[Due Date]))
Quarter Close Date = QUARTER(SELECTEDVALUE(Table[Close Date]))
 
Current Quarter Count =

CALCULATE(COUNT(Table[Status]), FILTER(Table, (Table[Status] = "Open" && [Quarter Due Date] = [Current Quarter]) || (Table[Status] = "Close" && [Quarter Close Date] = [Current Quarter]) ))
 
Next Quarter Count =

CALCULATE(COUNT(Table[Status]), FILTER(Table, (Table[Status] = "Open" && [Quarter Due Date] = [Current Quarter] + 1) || (Table[Status] = "Close" && [Quarter Close Date] = [Current Quarter] + 1) ))
 
Please find below the result for the current quarter count :).
 
Rudy_D_0-1674227694741.png

 

Helo @Rudy_D ,
Can you provide the file as I am applying same measures but getting blank. Can you provide the file please?

Please find my test file here :

 

Test 

Hello @Rudy_D ,
I checked but next quarter formula is not getting the correct outcome. 

I don't understand you expectation. 
Which are the 2 "close" that you expect for the next quarter ? For me there's only one in your table.

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.