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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Help with measure not filtering by date

Hi and this measure works in all ways but won't filter by date. Appreciate any thoughts? The aim of the measure is to count all those incidents that include in the text string any reference to "glass place", but exclude incidents if the word "door" is also included in the string (i.e. in the next sentence, etc). I'm not sure where to add a date filter in the measure/variable. Thanks all.

 

Excludes Door Incidents =

 

VAR _GlassPlace =

    CALCULATETABLE(VALUES('Incident Detail'[Incident Code]),

        SEARCH("glass place", 'Incident Detail'[Incident Details], 1, 0)>1,

        'Incident Cause'[Incident Cause Code] = "MAT")

 

VAR _DoorsExcluded =

    CALCULATETABLE(VALUES('Incident Detail'[Incident Code]),

     FILTER('Incident Detail', CONTAINSSTRING('Incident Detail'[Incident Details], "door"))

 

Return

    COUNTROWS(EXCEPT(_GlassPlace, _DoorsExcluded))

 

 

5 REPLIES 5
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous,

 

May I know how you would like to filter the Measure data by date filter? Do you want to count table rows when its date is equal to the selected date or before the selected date etc.? Is there any date column in your table?

 

If you still have problems on it, could you please provide some sample data from your tables and let me know how your create relationships for them? Thanks in advance!

 

Best Regards,

Community Support Team _ Caiyun

SpartaBI
Community Champion
Community Champion

@Anonymous hard to say with the info supplied but let's try by elimination.|
Try changing the snd var to this:

VAR _DoorsExcluded =

    CALCULATETABLE(VALUES('Incident Detail'[Incident Code]),

     FILTER(VALUSE('Incident Detail'[Incident Details]), CONTAINSSTRING('Incident Detail'[Incident Details], "door"))

Anonymous
Not applicable

Hi SpartaBI and thanks for responding to this one. No luck with updating as suggested. Apols re lack of info, let me know if you have any other thoughts...

@Anonymous I think I need to see the file in your case. Can you share it?

Anonymous
Not applicable

Hi and unable to share unfortunately. Appreciate you taking the time to respond. Thanks agian.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.