cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
admin11
Post Prodigy
Post Prodigy

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
jaideepnema
Solution Specialist
Solution Specialist

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 Specialist
Solution Specialist

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
jaideepnema
Solution Specialist
Solution Specialist

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

jaideepnema
Solution Specialist
Solution Specialist

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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors