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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
checkner
Frequent Visitor

Show number of requisition who were open

Hello,

 

I have the following table (example) with job requisitions who are open or closed with specific dates. Now I want to know how many requisitions were open in August (in a month, quarter, year..). In addition I want to be able to filter the visual by department etc., it is not just display a number. 

 

checkner_0-1696855000392.png

Correct is: 4 in August, 5 in September, 4 in October

IDStatusOpend dateClosed date
123456Open01.10.2023 
134567Open30.09.2023 
849403Closed29.08.202328.09.2023
049458Open29.08.2023 
234586Closed29.08.202313.09.2023
485967Closed29.08.202306.10.2023
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @checkner ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a date dimension table(DO NOT create any relationship with the fact table)

vyiruanmsft_0-1697524600647.png

2. Create a measure as below to get the number of requisition who were open

Number of requisition who were open = 
VAR _seldate =
    SELECTEDVALUE ( 'Date'[Date] )
VAR _yearmonth =
    YEAR ( _seldate ) & FORMAT ( _seldate, "MM" )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[ID] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            YEAR ( 'Table'[Opend date] ) & FORMAT ( 'Table'[Opend date], "MM" ) <= _yearmonth
                && (
                    ISBLANK ( 'Table'[Closed date] )
                        || YEAR ( 'Table'[Closed date] ) & FORMAT ( 'Table'[Closed date], "MM" ) >= _yearmonth
                )
        )
    )

3. Create a line chart

vyiruanmsft_1-1697524712197.png

Best Regards

View solution in original post

3 REPLIES 3
Idrissshatila
Super User
Super User

Hello @checkner ,

 

try the following

 

measure = calculate ( countrows ( YourTableName), closed date = blank )

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




The problem with the calculation is that it only gives me the open ones. However, I need the jobs that were open in the respective months/quarters. 


Correct should be: 4 in August, 5 in September, 4 in October

 

Anonymous
Not applicable

Hi @checkner ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a date dimension table(DO NOT create any relationship with the fact table)

vyiruanmsft_0-1697524600647.png

2. Create a measure as below to get the number of requisition who were open

Number of requisition who were open = 
VAR _seldate =
    SELECTEDVALUE ( 'Date'[Date] )
VAR _yearmonth =
    YEAR ( _seldate ) & FORMAT ( _seldate, "MM" )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[ID] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            YEAR ( 'Table'[Opend date] ) & FORMAT ( 'Table'[Opend date], "MM" ) <= _yearmonth
                && (
                    ISBLANK ( 'Table'[Closed date] )
                        || YEAR ( 'Table'[Closed date] ) & FORMAT ( 'Table'[Closed date], "MM" ) >= _yearmonth
                )
        )
    )

3. Create a line chart

vyiruanmsft_1-1697524712197.png

Best Regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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