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
selpaqm
Helper V
Helper V

Filter on Dynamic Rolling Average on Month Slicer

Hi All.

I have created below measure to reflects always 3 month figures when month slicer is used. 

 

3R =
CALCULATE(COUNT('Order'[Order/ not ordered]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH)))

 

However, when I try to add salesman figures with below formula, and click to month slicer it is directly show just choosen month figures not 3 months.

 

3R John =
CALCULATE(COUNT('Order'[Order/ notordered])
,DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH),FILTER('Order','Order'[Salesman]="John")))

 

below you may find a sample.

Sample.pbix 

1 ACCEPTED SOLUTION

@selpaqm , I have removed filter in these two formulae and move them in calculate and seem like they behave same now

3%R Martha = DIVIDE(
CALCULATE(SUM('Order'[Order/ not ordered]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH),'Order'[Salesman]="Martha"),
CALCULATE(COUNT('Order'[Order/ not ordered]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH),'Order'[Salesman]="Martha"))

3%R John = DIVIDE(
CALCULATE(SUM('Order'[Order/ not ordered]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH),'Order'[Salesman]="John"),
CALCULATE(COUNT('Order'[Order/ not ordered]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH),'Order'[Salesman]="John"))

 

Appreciate your Kudos.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@selpaqm , What is the expected value? Both table seem to have  same values

@amitchandak when click any month "working" table values are change and correct and also matching with below one but "not working properly" table start to show just clicked months figures

@selpaqm , I have removed filter in these two formulae and move them in calculate and seem like they behave same now

3%R Martha = DIVIDE(
CALCULATE(SUM('Order'[Order/ not ordered]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH),'Order'[Salesman]="Martha"),
CALCULATE(COUNT('Order'[Order/ not ordered]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH),'Order'[Salesman]="Martha"))

3%R John = DIVIDE(
CALCULATE(SUM('Order'[Order/ not ordered]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH),'Order'[Salesman]="John"),
CALCULATE(COUNT('Order'[Order/ not ordered]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH),'Order'[Salesman]="John"))

 

Appreciate your Kudos.

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.