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
dbrandone
Helper III
Helper III

Month Offset not filtering measure correctly for current month data

I have used Month, Week, Year and Day offsets in my date tables for many reports and never had any issues until today. I wrote the below measure which is fairly simple:

Calculate(

         COUNTROWS('RequestTable'),

         'RequestTable'[RequestType] = "Subscription",

         NOT('RequestTable'[RequestDate] = BLANK())

         'Date'[Month Offset] = 0
         )

 

I confirmed that the Date table is connected directly to the Request table and it is connected via the date column that I want to use to filter the dates. Both 'Date'[Date] and 'RequestTable'[RequestDate] are set to the same Date type (Date). The date table is "marked as date table". I created a table visual and this is what shows when I pull RequestId, RequestDate and the measure I wrote:

dbrandone_0-1636648966541.png

 

When I go into table view in PBI desktop and filter the columns manually based on what I am writing in the measure, I should get 376, but instead the measure is pushing out 928 and it is counting requests from back in 2015,2016 and other years not this year.

 

I thought it may be that there is some rows in the dataset where the request date is blank. Unfortunately, I have no control over this data source which is frustrating, so I have to take this data as is. Just in case that may have been the issue I added the NOT blank filter in the calculate measure.

 

Any ideas on why this may be happening. 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@dbrandone , Try like

 


Calculate(

COUNTROWS('RequestTable'),

filter('RequestTable', 'RequestTable'[RequestType] = "Subscription" && NOT(isblank('RequestTable'[RequestDate]))
,filter('Date','Date'[Month Offset] = 0)
))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@dbrandone , Try like

 


Calculate(

COUNTROWS('RequestTable'),

filter('RequestTable', 'RequestTable'[RequestType] = "Subscription" && NOT(isblank('RequestTable'[RequestDate]))
,filter('Date','Date'[Month Offset] = 0)
))

@amitchandak 

 

That worked! Thanks.


Was this an issue around filtering from two seperate tables? Trying to understand where it went wrong and why.

 

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.