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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

selected month hide and show previous three month value

i have chart based on the month wise .  my slicer month wise data 

 week date (table name -> Date PA)

THENNA_41_0-1630041039846.png

after  added  outbound text in  

 

Week (table name -> Date PA)

WEEK = var a = DATE(2020,08,03)
var b = IF (
DatePA[Week Date] = a,"Outbound GLOBAL",IF(DatePA[Week Date]<>BLANK(),"Outbound" & DatePA[Week Date]))
return b
 
THENNA_41_1-1630041249154.png

 

my slicer looks like  

THENNA_41_2-1630041600835.png

 

 

my column chart looks like 

 

 

THENNA_41_3-1630041642161.png


if i  select july month  slicer  july month should be hide and also  previous 3 month only visible . i have tired below code 

 

combine effective date =
 
VAR NumOfMonths = -3
VAR ReferenceDate = MAX ( 'DatePA'[WEEK] )
VAR PreviousDates =
DATESINPERIOD (
'combine effective date'[Effective Date],
ReferenceDate,
NumOfMonths,
MONTH
)
VAR Result =
CALCULATE (
SELECTEDMEASURE (),
REMOVEFILTERS ( DatePA[WEEK] ),
KEEPFILTERS ( PreviousDates )
 
)
RETURN Result
 
but its not  wokring any idea  selected month should be hidden previous  three  only month date visible based on the slicer selection 

 

2 REPLIES 2
SanketBhagwat
Solution Sage
Solution Sage

Hi @Anonymous .

As far as I understood from your problem, I think you need to show previous 3 months data expect the current selected month.

You can use the below measure;

P:revious 3 Months =
CALCULATE(SUM(Table1[Sales]),FILTER('Calendar','Calendar'[Month]>SELECTEDVALUE('Month'[Month]) && 'Calendar'[Month]<=SELECTEDVALUE('Month'[Month])-3))
 
Please let me know if it solves your problem.
 
If this post helps, then please mark it as 'Accept as Solution' so that other users could find it easily.
 
Regards,
Sanket Bhagwat
Anonymous
Not applicable

@SanketBhagwat  tired its not working 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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