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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Sweetsoda
New Member

Replacing a Filter Pane filter by a filter in a measure

Hi,

 

I have this measure [xyz] that sums the last 12 month revenue:

 

xyz =
VAR _Cuur_start = Max('Table Calendar'[Date]) -365
VAR _Curr_END = Max('Table Calendar'[Date])
return
    CALCULATE([Total revenue],DATESBETWEEN('Table Calendar'[Date], _Cuur_start,_Curr_END))
 
And the measure [x] should filter [xyz] for a subset of product references (to help forecasting):
 
x =
   calculate([xyz],
    filter('Total Material','Total Material'[Tag]="#Forecast")
     )
 
Yet [x] does not produce the expected results. Please take a look a this picture:
 
Screenshot 2023-02-20 194154.png
The visual is filtered (using the Filter pane) by 'Total Material'[Tag]="#Forecast". I would like to have [x] to have the values of [xyz] in this visual so I can use it without the visual filter. [x] only matches [xyz] for the year total. The references affected by the filter are not sold all months.
 
Any idea to get [x] performing like [xyz] also when the visual filter is cleared?
 
Regards,
2 REPLIES 2
Jngum
New Member

@Sweetsoda 
use this instead 
XYZ=
CALCULATE(
[Total revenue],
DATESINPERIOD('Table Calendar'[Date], MAX('Table Calendar'[Date]), -365, DAY)
)
I Datesinperiod actually returns a table and should give you the desired result.

Hi Jngum,

 

Your solution changes a bit some of the values of [xyz] but doesn't change the behaviour of [x].

 

[x] only matches [xyz] on year subtotals but not at every month level).

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors