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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Custom Slicer with two calender date pickers and custom periods ?

Hi Team ,

 

Can we create this kind of slicer in power bi? 

 

1. From Date Picker 

2. To Date Picker Sperately and

3. When we click on custom then only it display calender pickers

 

Sample Snap

 

Capture.PNG

 

Thanks In Advance 

Siddanth

 

 

6 REPLIES 6
amitchandak
Super User
Super User

@Anonymous , If you need slicer you can have it like

https://community.powerbi.com/t5/Desktop/Required-custom-date-Slicer-Last-7-days-last-15-days-last-30/m-p/1284966#M561629

or

https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115

 

For all month , week, day , qtr and year , refer these blogs. Use date table

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c3243d1f9

 

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 :radacad sqlbi My Video Series Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

How can we create calculations for below custom calculations ?

 

d.PNG

Hi @Anonymous ,

 

You could create a table for slicer then use SWITCH() function to match each value.

11.9.5.1.PNG

today =
IF ( MAX ( 'Table 2'[Date] ) = TODAY (), 1 )
this week =
IF (
    YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () )
        && WEEKNUM ( MAX ( 'Table 2'[Date] ), 2 ) = WEEKNUM ( TODAY (), 2 ),
    1
)
this month =
IF (
    YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () )
        && MONTH ( MAX ( 'Table 2'[Date] ) ) = MONTH ( TODAY () ),
    1
)
last month =
IF (
    YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () )
        && MONTH ( MAX ( 'Table 2'[Date] ) )
            = MONTH ( TODAY () ) - 1,
    1
)
this quarter =
IF (
    YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () )
        && QUARTER ( MAX ( 'Table 2'[Date] ) ) = QUARTER ( TODAY () ),
    1
)
last quarter =
IF (
    YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () )
        && QUARTER ( MAX ( 'Table 2'[Date] ) )
            = QUARTER ( TODAY () ) - 1,
    1
)
this year =
IF ( YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () ), 1 )
Measure =
SWITCH (
    SELECTEDVALUE ( ForSlicer[Period] ),
    "Today", [today],
    "This Week", [this week],
    "This Month", [this month],
    "Last Month", [last month],
    "This Quarter", [this quarter],
    "Last Quarter", [last quarter],
    "This Year", [this year]
)

After apply the measure to filter pane (set "is 1"),My final output looks like this:
11.9.5.2.gif

Or you could use Button 

11.9.5.3.gif

 

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Hi @v-eqin-msft ,

 

I've tried the same thing but it didn't work me (Previous Year measure). Attached is the pbix file

 

Here is the link :  https://1drv.ms/u/s!Au-aOkl1BoHuglWJsqvs_GgNx7vp?e=kHzgTu

 

Can you please hekp me out on these?

 

Thanks In Advance

Sid

 

MFelix
Super User
Super User

Hi @Anonymous,

 

This exact look and feel is not possible but the options are currently available when you add a date column to a slicer you have several options:

MFelix_0-1604660008537.png

If you combine a custom button for the selection alonside with some bookmarks you can do a similar experience altough the look is not the same. 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi Felix,

 

Can we add date picker in slicer ?

 

Snap

Dp.PNG

 

Thanks,

Vasu.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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