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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.