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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
rajendraongole1
Resident Rockstar
Resident Rockstar

Current month -1 in filter

Hi 

 

I am using filter slicer for date yyyy_mm by representing continously from 1st month to current month -1.

 

2019-01-01 2019-02-01 2019-03-01 2019-04-01 2019-05-01 2019-06-01 2019-07-01 2019-08-01 2019-09-01 

 

as like above but i want to highlight only currentmonth-1.

 

is there any possible way to select the current month -1 by default?

 

Please suggest.

 

Regards,

Rajendra

1 ACCEPTED SOLUTION

Hi @rajendraongole1

 

You can't do this directly in the report designer, but you should be able to do some modelling to make it work. Here we can create a custom column in power query based on date column.

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtNQ3MAQipVgdGNcSlWuBwjU0AHNjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"date", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Date.IsInPreviousMonth([date]) then "Previous Month" else [date])
in
    #"Added Custom"

Capture.PNG

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @rajendraongole1  ,

Please share sample data, or your .pbix file

 

Thank you

Robin

Hi

 

Please find the attached snapshot. i am using slicer with horizontal orientation,  by default it should select month-1.

.

monthmonth

 

Hi @rajendraongole1

 

You can't do this directly in the report designer, but you should be able to do some modelling to make it work. Here we can create a custom column in power query based on date column.

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtNQ3MAQipVgdGNcSlWuBwjU0AHNjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"date", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Date.IsInPreviousMonth([date]) then "Previous Month" else [date])
in
    #"Added Custom"

Capture.PNG

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Carousel June 2024

Check out the June 2024 Power BI update to learn about new features.

2
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.