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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

undefined

Hi ,

I have a month slicer ,

I have a bar graph which shows values like completed in progress etc.

my requirment is if I sect a month is Slicer like March 2020.

I shoud get bar graph which shows March month data and I need other bar chart which shows previous month which ever I have selected in slicer .

 

Please help me

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Please check the following steps.

1# Create a calendar table and a calculated calculated column "yearmonth" as slicer.

 

CALENDAR = CALENDAR(MIN('Table'[date]),MAX('Table'[date]))

yearmonth = FORMAT('CALENDAR'[Date],"YYYYMM")

 

2# Create two measures one for current month visual, another for previous visual.

 

Measure = IF(FORMAT(SELECTEDVALUE('Table'[date]),"YYYYMM")=SELECTEDVALUE('CALENDAR'[yearmonth]),1,0)

Measure 2 = IF(format(EDATE(SELECTEDVALUE('Table'[date]),1),"YYYYMM")=SELECTEDVALUE('CALENDAR'[yearmonth]),1,0)

 

3# Add measure to visaual level filter. Result would be shown as below.

1.PNG2.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

Please check the following steps.

1# Create a calendar table and a calculated calculated column "yearmonth" as slicer.

 

CALENDAR = CALENDAR(MIN('Table'[date]),MAX('Table'[date]))

yearmonth = FORMAT('CALENDAR'[Date],"YYYYMM")

 

2# Create two measures one for current month visual, another for previous visual.

 

Measure = IF(FORMAT(SELECTEDVALUE('Table'[date]),"YYYYMM")=SELECTEDVALUE('CALENDAR'[yearmonth]),1,0)

Measure 2 = IF(format(EDATE(SELECTEDVALUE('Table'[date]),1),"YYYYMM")=SELECTEDVALUE('CALENDAR'[yearmonth]),1,0)

 

3# Add measure to visaual level filter. Result would be shown as below.

1.PNG2.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , you can use time intelligence with date calendar . last MTD Sales

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
last year MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))


last QTR same Month (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,Qtr))))


MTD (Year End) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR('Date'[Date])))
MTD (Last Year End) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR(dateadd('Date'[Date],-12,MONTH),"8/31")))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Date.PNGValue.PNG

 

This is my date column and Values column..

I have different clients .

 

 

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.