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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
atowriss1
Advocate I
Advocate I

Filter Issue- Filter not working

Hi,

 

I am trying to get # of stores in our pipleline for the next month that have an estimated monthly revenue of 2K or greater.

 

Below is the Dax:

 

test = VAR _medate=selectedvalue(dimDate[Date].[Date])
VAR _numberofmonth=1
return
calculate(sum('EC Closed Report'[# of Rooftops]),
USERELATIONSHIP('EC Closed Report'[Exp Revenue Month Date],dimDate[Date]),

DATEADD(dimDate[Date].[Date],+1,MONTH),
FILTER(
   'EC Closed Report',
   calculate([Closed Rev]>=2000))
)
 
Without the filter, it calculates the correct # of stores, but once I add the filter, it comes up with nothing.
 
I even tried this- but it also retuned a blank:
test = VAR _medate=selectedvalue(dimDate[Date].[Date])
VAr _numberofmonth=1
return
calculate(sum('EC Closed Report'[# of Rooftops]),
USERELATIONSHIP('EC Closed Report'[Exp Revenue Month Date],dimDate[Date]),

DATEADD(dimDate[Date].[Date],+1,MONTH),
FILTER(
   'EC Closed Report',
  ( 'EC Closed Report'[Monthly Rev]>=2000))
)
 
Any ideas on what the issue could be?
 
Thanks
3 REPLIES 3
sevenhills
Super User
Super User

 

 

Try 1:

Test = 
VAR _medate = selectedvalue(dimDate[Date]) -- Not sure what is the use of this one, as no further reference
VAR _numberofmonth = 1 -- Not sure what is the use of this one, as no further reference
RETURN 
     CALCULATE ( 
         SUM ('EC Closed Report'[# of Rooftops]),
         USERELATIONSHIP('EC Closed Report'[Exp Revenue Month Date], dimDate[Date]),
         FILTER( ALL('EC Closed Report'), [Closed Rev] >= 2000)
         --,
         -- Not sure what this is doing here?
         -- DATEADD(dimDate[Date].[Date],+1,MONTH)
)

 

 

 

See if this portion of DAX works ... 

Without the date add it works, but returns stores with expected revenue in November, and I need expected revenue for December, which is why I had the DateAdd.  I tried putting the DateAdd after the filter, but that didn't work either.

-- Try 2: 
Test =  
VAR _medate = selectedvalue('EC Closed Report'[Exp Revenue Month Date]) 
RETURN 
     CALCULATE ( 
         SUM ('EC Closed Report'[# of Rooftops]),
         USERELATIONSHIP('EC Closed Report'[Exp Revenue Month Date], dimDate[Date]),
         FILTER( ALL('EC Closed Report'), [Closed Rev] >= 2000),
         DATESMTD(DATEADD(dimDate[Date], 1, MONTH))  
)

 

Optional Try 2.a.: To see the date range you wanted: 

Period Dates =
-- FYI, this is more for testing, not for calculating your measure
-- Create a table visual with 'EC Closed Report'[Exp Revenue Month Date] and Period Dates Measure and check the values

VAR _medate = selectedvalue('EC Closed Report'[Exp Revenue Month Date]) 
VAR _numberofmonth = 1  
var _nextmonth = IF ( _selDate = Blank(), 
                  EOMONTH(Minx(all('EC Closed Report'[Exp Revenue Month Date]), 'EC Closed Report'[Exp Revenue Month Date]), 1),
                  EOMONTH(_selDate, 1)
                 )
var _nextmonth_StartDate =  Date(Year(_nextmonth), Month(_nextmonth), 1)
VAR _nextmonth_EndDate =  _nextmonth
 
RETURN _nextmonth_StartDate & " : " & _nextmonth_EndDate
 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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