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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
CVanpat91
Frequent Visitor

Determine what status is on date

I need to be able to determine what the the status is of a location on a given date.  For example of the data below I need to bea ble to tell how many types are in each status on a given date.

Example: with the data below I need to be able to do a sum of all types that are in approved status as of the first of a month and year.  

 

datetypestatus
1/1/2014yellowinactive
2/5/2016blueApproved
7/4/2018redinactive
1/1/2020redPending
1/2/2020yellowpending
2/15/2020yellowapproved
8/8/2020blueinactive
5/8/2021redapproved
1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @CVanpat91,

 

You may try this Measure and make some changes to it per your needs.

CountForFirstOfMonth&Year =
VAR specificDate =
    DATE ( 2020, 11, 15) //specify a date
VAR asOfDate =
    DATE ( YEAR ( specificDate ), MONTH ( specificDate ), 1 ) //get the first day of specific month&year
VAR countType =
    CALCULATE (
        COUNT ( 'Table'[type] ),
        FILTER (
            'Table',
            LOWER ( 'Table'[status] ) = "approved"
                && 'Table'[date] < asOfDate
        )
    ) //calculate based on date before the first day of specific month&year
RETURN
    countType

 

Then, the result will look like this.

vcazhengmsft_0-1655088529675.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

View solution in original post

2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi @CVanpat91,

 

You may try this Measure and make some changes to it per your needs.

CountForFirstOfMonth&Year =
VAR specificDate =
    DATE ( 2020, 11, 15) //specify a date
VAR asOfDate =
    DATE ( YEAR ( specificDate ), MONTH ( specificDate ), 1 ) //get the first day of specific month&year
VAR countType =
    CALCULATE (
        COUNT ( 'Table'[type] ),
        FILTER (
            'Table',
            LOWER ( 'Table'[status] ) = "approved"
                && 'Table'[date] < asOfDate
        )
    ) //calculate based on date before the first day of specific month&year
RETURN
    countType

 

Then, the result will look like this.

vcazhengmsft_0-1655088529675.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

ManguilibeKAO
Resolver I
Resolver I

Hi,

Please, could you mention clearly what you have as input data, and what output you want?

 

Best regards.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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