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
dantabangcura
Frequent Visitor

Count of Active records based from Start and End Date

Hi,

 

I am currently building a report in which will count the number of records which has a "blank" termination date.

 

And also, what i want to do is whenever i select a specific year, it will count all the records from the beginning to the selected date.

 

Ex.

 

Selected year = 2016

Data to Display = All previous records up to selected year which is 2016

 

 

Thank you

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

@dantabangcura,

 

You may refer to the following DAX that adds a measure.

Measure =
IF (
    HASONEVALUE ( 'Calendar'[Date].[Year] ),
    CALCULATE (
        COUNTBLANK ( Table1[End Date] ),
        YEAR ( Table1[Start Date] ) <= VALUES ( 'Calendar'[Date].[Year] )
    )
)
Community Support Team _ Sam Zha
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

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@dantabangcura,

 

You may refer to the following DAX that adds a measure.

Measure =
IF (
    HASONEVALUE ( 'Calendar'[Date].[Year] ),
    CALCULATE (
        COUNTBLANK ( Table1[End Date] ),
        YEAR ( Table1[Start Date] ) <= VALUES ( 'Calendar'[Date].[Year] )
    )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
vanessafvg
Super User
Super User

@dantabangcura for blank values you can use

 

=COUNTBLANK(table[terminationdate])

create a measure for 

records for the year = calculate (countrows(table), year(date) =   2016)

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.