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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
camc00
Regular Visitor

Count rows before range set in date slicer

Hi all,

 

I am using a date 'Between' slicer to control many visuals in my report, it is using Calendar[Date].
In one of my table visuals I would like to create a column that includes a count of all rows in my 'Opportunity' table where the 'SubmissionDate' is less that the start date of my slicer, irrespective of whether any other date within the row falls within the date range set.

 

If any other information is required to resolve this request please let me know.

 

Thanks

 

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

Hi @camc00 

You can use crossfilter() function, you can refer to the following sample

Sample data 

vxinruzhumsft_0-1691033155909.png

Date table

vxinruzhumsft_1-1691033177529.png

 

Relationship

vxinruzhumsft_2-1691033203554.png

 

Then create a measure

Measure = CALCULATE(COUNTROWS('Table'),'Table'[Column2]<MIN('Table 2'[Date]),CROSSFILTER('Table 2'[Date],'Table'[Column2],None))

Output

vxinruzhumsft_3-1691033257468.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

4 REPLIES 4
v-xinruzhu-msft
Community Support
Community Support

Hi @camc00 

You can use crossfilter() function, you can refer to the following sample

Sample data 

vxinruzhumsft_0-1691033155909.png

Date table

vxinruzhumsft_1-1691033177529.png

 

Relationship

vxinruzhumsft_2-1691033203554.png

 

Then create a measure

Measure = CALCULATE(COUNTROWS('Table'),'Table'[Column2]<MIN('Table 2'[Date]),CROSSFILTER('Table 2'[Date],'Table'[Column2],None))

Output

vxinruzhumsft_3-1691033257468.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.

 

 

ryan_mayu
Super User
Super User

maybe you can try use ALL function to disable the slicer

ALL function (DAX) - DAX | Microsoft Learn

or you can use visual interact to disable the relationship between the visual and the slicer

 

Change how visuals interact in a report - Power BI | Microsoft Learn





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks for your reply, the ALL function looks good, however I would still need to use the start date of the slicer to be able to filter all rows where SubmissionDate is less is than that start date.

 

How would I manage this?

 

Thanks

could you pls provide some sample data and the expected output?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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