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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
CelsoJ
Regular Visitor

Pending Contract for approval by month

Hi,

 

I have the table below and wanted to create a measure for how many contracts were/are pending in our pipeline by month/quarter. I have a separate Calendar table on my BI called DATETABLE.

 

 

By "Pending" I mean any contracts with a Start Date that did not have a End Date within a certain month. For example:

 

How many clients in March had a Start Date but no end date by the 31st of that month? And so on.

 

ClientStart DateSigned Date
 Client 1 22/06/202309/08/2023
 Client 2 19/05/202303/08/2023
 Client 3 21/06/2023 
 Client 4 07/12/202218/05/2023
 Client 5 05/05/202326/07/2023
 Client 6 19/06/2023 
 Client 7 25/10/202208/06/2023
 Client 8 10/05/202306/07/2023
 Client 9 21/06/202307/08/2023
 Client 10 20/06/2023 
 Client 11 27/10/202228/04/2023
 Client 12 15/11/202208/06/2023
 Client 13 23/03/2023 
 Client 14 17/05/202321/07/2023
 Client 15 18/11/202202/05/2023
 Client 16 01/02/202328/03/2023
 Client 17 11/05/202318/07/2023
 Client 18 26/06/202318/07/2023
 Client 19 13/12/2022 
 Client 20 12/08/202211/05/2023
 Client 21 31/10/202226/07/2023
 Client 22 10/01/202305/07/2023
 Client 23 26/04/2023 
 Client 24 22/02/202331/05/2023
 Client 25 15/11/202208/06/2023
 Client 26 20/06/2023 
 Client 27 20/06/2023 
 Client 28 07/03/202309/06/2023
 Client 29 12/05/2023 
 Client 30 13/12/202224/04/2023
 Client 31 16/02/2023 
 Client 32 01/08/2022 
 Client 33 18/04/202319/06/2023
 Client 34 17/05/202325/07/2023
 Client 35 27/04/202309/08/2023
 Client 36 04/10/202202/05/2023
 Client 37 18/11/2022 
 Client 38 03/03/202311/07/2023
 Client 39 23/03/2023 
 Client 40 26/04/202320/07/2023
 Client 41 20/06/2023 
 Client 42 11/11/202203/05/2023
 Client 43 26/10/202205/07/2023
 Client 44 10/05/202326/07/2023
 Client 45 25/06/202310/08/2023
 Client 46 10/01/202328/04/2023
 Client 47 18/04/2023 
 Client 48 24/02/2022 
 Client 49 21/12/202207/07/2023
 Client 50 28/02/202321/06/2023
 Client 51 24/03/202307/08/2023
 Client 52 05/05/2023 
 Client 53 09/01/2023 
 Client 54 26/05/2023 
 Client 55 10/05/202322/06/2023
 Client 56 18/10/202213/06/2023
 Client 57 12/05/2023 
 Client 58 12/06/2023 
 Client 59 09/03/202326/06/2023
 Client 60 26/04/202329/06/2023
 Client 61 02/06/202307/07/2023
 Client 62 23/06/2023 
 Client 63 05/05/2023 
 Client 64 28/04/2023 
 Client 65 04/04/202321/06/2023
 Client 66 09/02/202302/06/2023
 Client 67 02/03/2023 
 Client 68 17/05/202310/08/2023

Thank you!

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

Hi  @CelsoJ ,

 

Here are the steps you can follow:

1. Create measure.

Flag =
var _selectmonth=SELECTEDVALUE('Date'[Date].[MonthNo])
var _selectyear=SELECTEDVALUE('Date'[Date].[Year])
var _mindate=DATE(_selectyear,_selectmonth,1)
var _maxdate=EOMONTH(_mindate,0)
return
IF(
    MAX('Table'[Start Date])>=_mindate&&MAX('Table'[Start Date])<=_maxdate&&MAX('Table'[Signed Date])=BLANK(),1,0)
Count =
COUNTX(ALLSELECTED('Table'),'Table'[Client])

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_0-1692671526392.png

3. Result:

vyangliumsft_1-1692671526395.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

6 REPLIES 6
v-yangliu-msft
Community Support
Community Support

Hi  @CelsoJ ,

 

Here are the steps you can follow:

1. Create measure.

Flag =
var _selectmonth=SELECTEDVALUE('Date'[Date].[MonthNo])
var _selectyear=SELECTEDVALUE('Date'[Date].[Year])
var _mindate=DATE(_selectyear,_selectmonth,1)
var _maxdate=EOMONTH(_mindate,0)
return
IF(
    MAX('Table'[Start Date])>=_mindate&&MAX('Table'[Start Date])<=_maxdate&&MAX('Table'[Signed Date])=BLANK(),1,0)
Count =
COUNTX(ALLSELECTED('Table'),'Table'[Client])

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_0-1692671526392.png

3. Result:

vyangliumsft_1-1692671526395.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Ritaf1983
Super User
Super User

Hi @CelsoJ 
Can you please explain what you mean by "pending" ?

Does it refer to what is active on the selected date?
In other words, do you mean that the selected date is greater than your start date and less than your end date?

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi Sorry, good question.

 

By "Pending" I mean any contracts with a Start Date that did not have a End Date within a certain month. For example:

 

How many clients in March had a Start Date but no end date by the 31st of that month?

 

I have amended my question to reflect this clarification.

Sorry, I still don't understand.
Do you choose a specific period or month?

It will be helpful if you can provide an example of the highly desired result...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

I wanted to be able to track it month-by-month with a Line Tracker, example of result:

 

Contracts that did not have an end date by end-of-march from that list were:

CLIENTS     Start Date    Signed Date

 Client 3 21/06/2023 
 Client 6 19/06/2023 
 Client 10 20/06/2023 
 Client 13 23/03/2023 
 Client 19 13/12/2022 
 Client 23 26/04/2023 
 Client 26 20/06/2023 
 Client 27 20/06/2023 
 Client 29 12/05/2023 
 Client 31 16/02/2023 
 Client 32 01/08/2022 
 Client 37 18/11/2022 
 Client 39 23/03/2023 
 Client 41 20/06/2023 
 Client 47 18/04/2023 
 Client 48 24/02/2022 
 Client 52 05/05/2023 
 Client 53 09/01/2023 
 Client 54 26/05/2023 
 Client 57 12/05/2023 
 Client 58 12/06/2023 
 Client 62 23/06/2023 
 Client 63 05/05/2023 
 Client 64 28/04/2023 
 Client 67 02/03/2023 

 

Which are blanks and also:

 

 Client 16 01/02/202328/03/2023

 

The total count of contracts that were pending during that period would then be:

 

26

 

But I'd like to create a measure where I can, connecting this table with a Calendar table, have that tracked month-by-month.

@Ritaf1983, forgot to @ you here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors
Top Kudoed Authors