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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

Exclude a dates slicer in measure and include another date field in the meausre

Hi

I need to calculate a distinct policy based on from dt and to date from the policy table. I also have a calendar dates table which is a calculated table. User will choose the date in dates table and based on user selection I need to calculate the policycount based on the interval selected in dates table. Suppose if the user chose between 1-jan-2023 and 31-jan-2023 I need to get the policy count from policy table as from_dt<=31-jan-2023 and to_dt>=31-jan-2023

MAXPOLICYCOUNT =
VAR _max = MAX( Dates[Date] )
RETURN
CALCULATE (
DISTINCTCOUNT ( pol_table[POL_NO]) ,

pol_table[_DT_TO] >= _max , pol_table[_DT_FM] <= _max

)

Maxpolicycount1 = CALCULATE([MAXPOLICYCOUNT],USERELATIONSHIP(pol_table[_DT_TO],Dates[Date]))

srutiR2403_0-1719407840504.png

the above result is correct this is expected (maxpolicycount1). But in dashboard i would be having dates slicer so when dates slicer is present all the values are showing as incorrect so i need to avoid the dates slicer and in above output u could find i have dt_to slicer. This dt_to slicer will not be available in dashboard therfore i need to include dt_to filter in the measure and exclude dates slicer from the measure. i tried to use datesbetween for dt to field but it says it has duplicate values for the column

1 ACCEPTED SOLUTION
Anonymous
Not applicable

No this will not work as the measure created is having max(date) 

I created separate policy table unconnected with the date table and resolved this issue

View solution in original post

2 REPLIES 2
newellaa
Frequent Visitor

Not sure if I understand but it seems like you don't want the date slicer to interact with the visual that does the count. If you click on the date slicer then go to Format and Edit Interactions you can stop the slicer from interacting with other visuals.

newellaa_0-1719414788551.png

 

Anonymous
Not applicable

No this will not work as the measure created is having max(date) 

I created separate policy table unconnected with the date table and resolved this issue

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.