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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Pranav13
Regular Visitor

Need help to get a measure from which I can get the number of entries which is below a specific date

Hello All,

 

I am looking to get a measure from which I can get the number of entries in the excel which falls below the specific date.

Also the specific date has to be determined with a measure from the current date (Today).

 

So in excel what data I have is like Column with category and a column of date and from this i need to extract the categories which comes below a specific date. For example the count of category before 10/10/2023.

2 ACCEPTED SOLUTIONS

Hi @Pranav13 

Based on your description, you can try the following.

Measure = CALCULATE(COUNTROWS('Table'),'Table'[Date]<DATE(2022,2,22),'Table'[Date]<>BLANK())

Output

vxinruzhumsft_0-1728539593917.png

 

Best Regards!

Yolo Zhu

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

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1728616302602.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

12 REPLIES 12
v-xinruzhu-msft
Community Support
Community Support

Hi,

Thanks for Ashish_Mathur 's concern about the problem and i want to offer some more inforamtion for user to refer to.

hello @Pranav13 , based on your descriprtion, you can refer to the following sample.

Sample data.

vxinruzhumsft_0-1728538409653.png

Create a measure

Measure = CALCULATE(COUNTROWS('Table'),OR('Table'[Date]<DATE(2022,2,22),'Table'[Date]=BLANK()))

Output

vxinruzhumsft_1-1728538561847.png

If you need to set the filter date to today(0, just replace the meaausre to the following.

CALCULATE(COUNTROWS('Table'),OR('Table'[Date]<TODAY(),'Table'[Date]=BLANK()))

 

 

Best Regards!

Yolo Zhu

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

Sorry . I don't want the NA/Blanks to be counted - The entries with dates only has to be counted

Hi @Pranav13 

Based on your description, you can try the following.

Measure = CALCULATE(COUNTROWS('Table'),'Table'[Date]<DATE(2022,2,22),'Table'[Date]<>BLANK())

Output

vxinruzhumsft_0-1728539593917.png

 

Best Regards!

Yolo Zhu

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

Pranav13
Regular Visitor

So my need is to get the number of location entries from this 2 columns which is before 24-Feb-22

So to be exact My expected output from the measure is 9 from the example.

 

Share both columns together.  Why should the answer be 9?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

IF Bonded - Bond Date else NALocation of Monitor
24-Feb-221R-007
25-Feb-221R-008
26-Feb-221R-009
27-Feb-221R-010
24-Feb-221R-011
24-Feb-221R-012
24-Feb-221R-013
NA1R-014
28-Dec-221R-015
24-Feb-221R-016
24-Feb-221R-017
24-Feb-221R-018
NA1R-019
28-May-211R-020
28-Dec-211R-021
28-Dec-211R-022
28-Dec-211R-023
28-Dec-211R-024
28-Dec-211R-025
28-Dec-211R-026

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1728616302602.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks Ashish - i will try and let you know

Sorry the count i wish is 7 - as the dates which are before 24th February 2022 - there are 7 entries in the column. So whenever a date is given whichever comes below specific date will be counted and output is given

Pranav13
Regular Visitor

Next Column

Location of Monitor
1R-007
1R-008
1R-009
1R-010
1R-011
1R-012
1R-013
1R-014
1R-015
1R-016
1R-017
1R-018
1R-019
1R-020
1R-021
1R-022
1R-023
1R-024
1R-025
1R-026
Pranav13
Regular Visitor

Date Column

IF Bonded - Bond Date else NA
24-Feb-22
25-Feb-22
26-Feb-22
27-Feb-22
24-Feb-22
24-Feb-22
24-Feb-22
NA
28-Dec-22
24-Feb-22
24-Feb-22
24-Feb-22
NA
28-May-21
28-Dec-21
28-Dec-21
28-Dec-21
28-Dec-21
28-Dec-21

28-Dec-21

Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file.  Show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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 Kudoed Authors