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
admin11
Memorable Member
Memorable Member

How to create a button when trigger it will select current month = march ?

Hi All

 

I like to create a button , when user click on it , it will select month = 3 , since now is march.

admin11_0-1614669652166.png

 

Paul

 

1 ACCEPTED SOLUTION

Hi @admin11 ,

Please change the calculated column as shown below to get previous month:

Current Month = IF(AND(MONTH('Date'[Date])=MONTH(NOW())-1,YEAR('Date'[Date])=YEAR(NOW())),"Current Month - 1")

 

Here is the file 

https://we.tl/t-Mp1w9Ojtyj

 

Please accept this as a solution if your question has been answered

Appreciate a Kudos 😀

View solution in original post

5 REPLIES 5
jaideepnema
Solution Sage
Solution Sage

Hi @admin11 ,

Check this file

https://we.tl/t-gvmk306GcN

 

@jaideepnema  

Thank you very much. it work fine now.

Can you pls share with me why i modify the expression below , it does not work :-

 

Current Month - 1 =  IF(AND(MONTH('Date'[Date])=MONTH(NOW()-1),YEAR('Date'[Date])=YEAR(NOW())),"Current Month - 1")
 
Basically i need to get previous month.
 
Paul

Hi @admin11 ,

Please change the calculated column as shown below to get previous month:

Current Month = IF(AND(MONTH('Date'[Date])=MONTH(NOW())-1,YEAR('Date'[Date])=YEAR(NOW())),"Current Month - 1")

 

Here is the file 

https://we.tl/t-Mp1w9Ojtyj

 

Please accept this as a solution if your question has been answered

Appreciate a Kudos 😀

jaideepnema
Solution Sage
Solution Sage

Hi @admin11 ,

You can create a calculated column like this and use this in the slicer to filter data for the current month

Current Month = IF(AND(MONTH(Data[Date])=MONTH(NOW()),YEAR(Data[Date])=YEAR(NOW())),"Current Month")
Just apply a not blank filter 
 
Hope this helps !! 😀
 

@jaideepnema 

 

Than you for sharing.

I just try i get error . it cannot detect my Date field at Date Table.

 

below is my PBI file :-

https://www.dropbox.com/s/yhzogjwlqzjig74/PBT_V2021_352%20How%20to%20create%20button%20to%20select%2...

 

admin11_0-1614672602317.png

 

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.