Тёмный

Power BI - How to Set a Default Slicer Value 

BI Elite
Подписаться 71 тыс.
Просмотров 147 тыс.
50% 1

Thanks for helping me get to 1000 subscribers! Let's celebrate with a fun trick that allows you to set default slicer selections! This is a fun trick that seems to be asked about a lot. In this video, I will show you how to default your data to show the current month's data.
Enroll in my introductory or advanced Power BI courses:
training.bielite.com/
Elite Power BI Consulting:
bielite.com/
Data Insights Tools:
www.impktful.com/

Наука

Опубликовано:

 

2 июл 2018

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 76   
@exilestreethawk6822
@exilestreethawk6822 4 года назад
A solid technique for sure. However, what a lot of people are looking for is a way to change the actual slicer selection upon refresh. For example, imagine a model is updated weekly, and there is a slicer set to filter on the latest week (i.e. "week ending mm/dd/yyyy"). When the report is updated, the slicer for week does not "change itself" to the newest week; users are still required to make that change. Thanks for all your contributions to the community!
@shaunandkatewilkinson1746
@shaunandkatewilkinson1746 3 года назад
The technique shown is appreciated but like you say what you really want to be able to show your users is which item is the slicer is the default. Ie in the example in the video if Current Month is used when nothing selected in the slicer then you'd want it shown to the user as being selected otherwise the user does not now in any easy manner what is being selected. Dates are a perfect example where you want it to defualt - in the slicer - to a particular date without forcing people to select it everytime they load the report
@brainpowersolutions4472
@brainpowersolutions4472 3 года назад
Yes, that is what I am looking for as well. For a report the current reporting year must be selected in the slicer. In februari the report must show the data for the new reporting year and I was hoping for a solution to set the new reporting year selected in the slicer. Modifying all measures to default to a certain year is not always desirable.
@denwo1982
@denwo1982 Год назад
@@brainpowersolutions4472 did you find a solution for this?
@BrandyBurkhaulter
@BrandyBurkhaulter 4 месяца назад
Same here. I want my slicer to show the selected default values. So if I have a default of the last 4 months, my slicer should show that the last 4 months are selected.
@pratikfutane8131
@pratikfutane8131 5 лет назад
What a Great Video..Amazing DAX logics. Thanks a lot!!
@BIElite
@BIElite 5 лет назад
Thanks Pratik! Sorry for the late response
@Balgalw
@Balgalw 3 года назад
This measure here is a pure gold, thanks a lot! Can be used for any period, week, year with a little tweak For my task - get variable filter for each month of 3 years i only need to + YEAR - YEAR * 12 Var. filter = IF( MONTH('Date'[Date]) = MONTH(TODAY()) && YEAR('Date'[Date]) = YEAR(TODAY()), 0, MONTH(TODAY()) - MONTH('Date'[Date]) + ((YEAR(TODAY()) - YEAR('Date'[Date])) * 12) )
@dannyngo8704
@dannyngo8704 4 года назад
I couldn't get the second IF statement to work with dates (results just showed blank), but it worked once I replaced it with a Filter expression. Either way, I've been looking for this solution for a while now. Thanks so much for sharing!
@helderbnunes
@helderbnunes 4 года назад
Great! I had a similar problem, and thanks to you my problem is solved. Thanks a lot! ;)
@BIElite
@BIElite 4 года назад
Thanks for watching, Helder!
@joceirchaves316
@joceirchaves316 7 месяцев назад
Great solution! Thank you so much!
@MrErolyucel
@MrErolyucel 6 лет назад
Thanks. Great video tutorial.
@BIElite
@BIElite 6 лет назад
+Erol Yucel thanks for watching!
@lgr_cr4zy11
@lgr_cr4zy11 5 лет назад
Life saver....thanks!
@BIElite
@BIElite 5 лет назад
Thanks for watching, Bro Slayer!
@kennethstephani692
@kennethstephani692 2 года назад
Great video!
@bibinbastian01
@bibinbastian01 6 лет назад
Indeed a cool trick !!!
@BIElite
@BIElite 6 лет назад
Thanks Bibin!
@jbyxxx
@jbyxxx 5 лет назад
Inspiring video, thanks .. I found it when i was looking for a solution for my case, which I have an event calendar table and want to show one event (let's say event A) with each other single events, so it is more like event A should always be in the calendar with the other event(s) which is (are) selected by the user. I appreciate any suggestion/help. Thanks :)
@BIElite
@BIElite 5 лет назад
Ah that's a super interesting scenario... I think you will be able to do this using a very similar method to this video. I can't think of the exact solution right now, but if you have a sample PBIX that you could send me, I'd love to take a crack at it. Email: powerbielite@gmail.com
@PabloSansEgo
@PabloSansEgo 3 года назад
This works great IF you've got only a few different visuals... But Is there a way to set a default slicer for the entire report? (not just specific visuals) - I've got dashboards with literally 40-50 visuals spanning a few pages.
@RVAraghav
@RVAraghav 5 лет назад
Nice!
@BIElite
@BIElite 5 лет назад
Thanks for watching!
@minstreltokunbo
@minstreltokunbo 3 года назад
How did you create the month's tabs?
@tuanhanhpham6328
@tuanhanhpham6328 3 года назад
do you ahve a video how to make that exact slicer ? Thx
@pranavratnalikar
@pranavratnalikar 3 года назад
what if the column we want defaultselection for is not a date column rather what if it's a text column. If column has value like '2020-21'. Is it possible to do it for text column??
@karloisaac2597
@karloisaac2597 11 месяцев назад
This is indeed cool; however, what most of us wish is to **visually** have the slicer change to a default value. With this trick, it can be confusing for the user since they don't know the actual value filtered in the visualizations.
@CyNETTx
@CyNETTx 3 года назад
This does not "set a default slicer value"; this only filters data based on slicer (or simulate click on "Current Month" when nothing is selected), but slicer is not setup automatically based on some data. I'm looking for solution: when new day is processed in DWH, I need slicer to be automatically switched for that new date.
@paulkneipp9488
@paulkneipp9488 3 года назад
I've noticed that a few vids like this, which claim to show you how to set a default slicer value but actually show you how to cope with a slicer which has no selected value. If you make a slicer's Selection Controls to Single Select, it will create a default value but it doesn't give you control over what that default value is.
@PolarBunny
@PolarBunny 4 года назад
How do i do it for the days in a month? How do i write the dax for it? Sorry. Pretty new to this.
@BigBear17
@BigBear17 5 лет назад
Hello great video. I tried working on this but the date range is giving me wrong "Month(s) ago" values since there are data from last year. How do I deal with this?
@BIElite
@BIElite 5 лет назад
+Neal Virtudes good point, a better way to calculate the months would be the DATEDIFF function. DATEDIFF(,,MONTH)
@venkatareddykummitha5863
@venkatareddykummitha5863 2 года назад
I have data from Jan/01/2021 to up to current date and also future dates in my date table. I want to show the current month as the default Month in slicer dynamically ( whenever we are getting the latest data)
@Laxmanmane007
@Laxmanmane007 4 года назад
how to count how many itmes selected in slicer in power Bi ?
@shaoboji437
@shaoboji437 5 лет назад
Thanks for the video. But I am confused: if we selected all or none, the logic goes to the second IF, how can the expression SelectedValue(data[daterange]) = "Current Month" be true, it should return Blank(). Anyone could help?
@tomhammarberg6384
@tomhammarberg6384 4 года назад
That's what I get too... ???
@tomhammarberg6384
@tomhammarberg6384 4 года назад
This would give the defult: CALCULATE( SUM(Data[Amout]); Data[DateRange] = "21 Month(s) Ago" )
@MichelleMassaMCM
@MichelleMassaMCM 4 года назад
What about for multirow cards?
@vimukthiamarasena6264
@vimukthiamarasena6264 2 года назад
Hi little confused on second if part...when nothing is selected how does selectedvalue DAX return "Current month"
@rushabh6492
@rushabh6492 2 года назад
How is current month returned ? instead all values are selected by default in a slicer. I tried implementing this but didnt work for me.
@JK-yd9jy
@JK-yd9jy 5 лет назад
if i'm not mistaken, this just "defaults" to sum certain rows; it doesn't really filter your data unless you've already kind of pivoted everything into a single table and it's all numerical data. otherwise, it's just a ginned-up sumif expression which makes it useless for folks trying to set a default filter on appended tables/datasets based on source.name. could be mistaken tho.
@BIElite
@BIElite 5 лет назад
+J K The point of this demonstration is to highlight the method of identifying if a selection has been made on a slicer. This will default to a certain calculation depending on if a selection or no selections are made. You can make it as complex as you like. In this example, the calculation is pretty easy everything is on one table.
@avpr1c
@avpr1c 5 лет назад
Can you just put daterange in the page filter and tick select all for a card?
@BIElite
@BIElite 5 лет назад
Hi Tedro, not sure exactly what you mean. Can you explain?
@KleinmeisterPang
@KleinmeisterPang 3 года назад
Good video ... Remembered me of my old Excel days, but it seems you are missing the point. What people in all those forums mean is: click on a slicer value, hit save, exit and every time the dashboard is opened, this saved selection is there! That is the stuff which drives people crazy, not that you cannot prefilter (which is basically what you are doing here) the data which is affected by those slicers! In 2021 power bi still cannot do the simplest things as storing column widths (permanently no matter of which slicer...), Store default drop-down selection, get proper formatting etc. Etc.
@genovjillella3602
@genovjillella3602 Год назад
How did you get the Amount column?
@sunilkamat3520
@sunilkamat3520 4 года назад
I get the result as Blank, am I missing something, please help
@marianmolina9022
@marianmolina9022 3 года назад
Hello, is there a similar workaround to default a slicer based on user log in? The RLS settings work fine, but when the dashboard is accessed the slicers are not automatically selected. What I was hoping to do is: If user 1 logs in, this user should automatically see his or her own data and the slicer is automatically selected. But based on user 1’s role, he/she should still be able to see other options in the slicers. What I am having issue now is when user 1 logs in, this user can see the options relevant to him/her but the slicer is not automatically selected by default so the visuals still show blank. Appreciate your advice. Thanks in advance!
@leelewis1051
@leelewis1051 2 года назад
Same here. How to select a a location slicer value from table of user and location as the default slicer? And the kicker, direct query on D365 Dataverse. Why is this so hard? :)
@8g8819
@8g8819 6 лет назад
👍👍👍
@BIElite
@BIElite 6 лет назад
Lol thanks giavo
@florencialessa9933
@florencialessa9933 6 лет назад
Hi! What if I wanted to set 2 slicers as a default? Let's say Región and Currency. Is it posible to add a "&&" to the SELECTED VALUE filter?
@BIElite
@BIElite 6 лет назад
Good question Florencia... you could definitely throw in a && but I think you'd also have to write some more code to determine if this second slicer has a selection or not. Are you going to be showing this second slicer on the page?
@tomasr27
@tomasr27 5 лет назад
I have a similar question. I have 1 slicer, but about 6 different "metrics" that I am displaying in 6 different cards. This means, I need a measure for each of them, since they all use different data. Is there a better approach for this? Thanks!
@abhishekshrivastav2141
@abhishekshrivastav2141 4 года назад
Hi I am unable add date range column using mention function can you please help me
@abhishekshrivastav2141
@abhishekshrivastav2141 4 года назад
Reply please
@tomhagedorn1674
@tomhagedorn1674 3 года назад
It appears your calculation returns negative "Months Ago" when calculating months from different years
@shubhamkulkarni6486
@shubhamkulkarni6486 5 лет назад
Good one! but it should be like if all filters are selected then it should show all data instead of current month..and if none is selected then current month data..?
@BIElite
@BIElite 5 лет назад
All and none are the same thing here! It’s unfortunate but I haven’t found a solution that can distinguish between all/nine selected since the default slicer functionality dictates that all values are selected when none are selected.
@shubhamkulkarni6486
@shubhamkulkarni6486 5 лет назад
ohk.. thanks for the clarification.
@sripriyabs
@sripriyabs 5 лет назад
How can we do this if we have String filters, Thanks in advance
@BIElite
@BIElite 5 лет назад
+sripriyabs sorry I don't follow. What are you trying to accomplish?
@sripriyabs
@sripriyabs 5 лет назад
Actually I have a slicer as a Status which has Active, Inactive and closed. I want to set the default value as active. I understand your approach works good for Date fields but its not working for String field. Hope this is clear
@nicheplayer
@nicheplayer 4 года назад
@@sripriyabs yes, I'm wondering the same. I have a map on which I'd like the default country displayed (i.e., no filters selected) to be USA unless the COUNTRY filter is anything other than USA.
@sahiljainnit
@sahiljainnit 4 года назад
The previous year months also shows the same months ago value as of the current year. Hence not useful to my data as my data has values for 3 years.
@MrAszpic
@MrAszpic 4 года назад
Use YEAR(Date) = ... & MONTH(Date) = ..., or the AND function for both year and month.
@Anatoli8888
@Anatoli8888 5 лет назад
The method of getting N months back calculation won’t work even when you are in January but want to include November and December.
@BIElite
@BIElite 5 лет назад
Hey Anatoli, you're right and I've recently started changing how I do this. I use the following formula: DATEDIFF(Table1[Date],DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())),MONTH)
@Anatoli8888
@Anatoli8888 5 лет назад
​@@BIElite Thanks. I used a similar logic to get the selected date first with (this will return the last day of the month from the slicer): SelectedDate = EOMONTH(DATEVALUE([SelectedSummarisedYear] & "-" & [SelectedSummarisedMonth] & "-01"), 0). Then SelectedDateMinusN_Mths = EDATE([SelectedDate], -[Parameter Value]) will return the number of months back in the "what if parameter".
@BIElite
@BIElite 5 лет назад
@@Anatoli8888 Nice! I like that
@ericbrenner690
@ericbrenner690 3 года назад
You're not taking into account that your end users may want to see all 4 months worth of data. You're assuming that if all boxes are selected to just display the current month.
@jancar1964
@jancar1964 2 года назад
That would be like a special requirement from the final user, I got it for example LOL
@granand
@granand 2 года назад
Hey Thanks Bro, Filtered google to get here and this is close, so can I ask or any expert here some questions. I have a scenario 1. Status that I am set for slicer that has huge list. I cannot use this as this requires aggregate function to be given as must, but I cannot do aggregation and it is cribbing FTODefaultTest = If ( COUNTROWS(DISTINCT(ALLSELECTED(_Work[Status]))) < COUNTROWS(DISTINCT(ALL(_Work[Status]))), MIN(_Work[Status]), /* I cannot have MIN on values returned by system to select, I am not calling a measure. */ If ( SELECTEDVALUE(_Work[Status])= " Scheduled", MIN(_Work[Status]), BLANK() ) - I get blank, how do we fix this, 2. I want to set multiple options as default 3. Similarly i need to set 3 FY years from current year as default Any help?
@yusufbas035
@yusufbas035 Год назад
where are you at bro
Далее
Non-Sticky Slicer Trick in Power BI
17:38
Просмотров 10 тыс.
Slicing by Measure Categories in Power BI
10:42
Просмотров 55 тыс.
Custom Date Period Selections in Power BI
10:42
Просмотров 110 тыс.
Master Power BI with AI | @PavanLalwani
12:33
Просмотров 64 тыс.
iPhone 14 китайский сборка!
1:00
Просмотров 197 тыс.
КРАХ WINDOWS 19 ИЮЛЯ 2024 | ОБЪЯСНЯЕМ
10:04