A TWIST on dynamically filtering visuals by a slicer in Power BI

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии • 98

  • @MSFT_ScottSewell
    @MSFT_ScottSewell 3 года назад +56

    That Scott guy sounds high-maintenance. 😉

  • @AbelChakaDebela
    @AbelChakaDebela 3 года назад +4

    I enjoy the way you present content over the solutions. Thank you for making life easier.

  • @RoshenRRujj
    @RoshenRRujj 3 года назад

    This whole day I've been cracking my head over it!!! FINALLY !!!!!

  • @MicahandModesta
    @MicahandModesta 2 года назад

    Omg FINALLY. It's taken me ages to work this one out. Even a couple of my other trusty youtubers didn't quite have a solution that worked for me. Thank you!

  • @luisalejandrorodriguezcamp9516
    @luisalejandrorodriguezcamp9516 3 года назад +1

    I came with a similar solution some time ago and I was very proud of myself and I thought "This should be a Guy In a Cube video"

  • @crackerzin-bi6746
    @crackerzin-bi6746 3 года назад

    Wow - simply superb Patrick!! Amazed with your idea and solution..

  • @sirojiddinsobirov5508
    @sirojiddinsobirov5508 3 года назад +1

    Whenever I hear that Patrick is saying 'yoooooo!' , I know there will be another cool thing to learn about Power BI! Thanks man!

  • @TainuiaKid1973
    @TainuiaKid1973 3 года назад

    Awesome solution, great work Patrick.

  • @jagadeeshbi5703
    @jagadeeshbi5703 3 года назад +1

    Brilliant Patrick.I have a question for you I have 4 measures like sales,Trans Margin,%TRans Margin and %Contribution and user wants these measures as slicers with in single column like Dynamic column selection. Kindly do needful on this.

  • @HarishS12137
    @HarishS12137 3 года назад +1

    Exactly what I wanted, this is great 👍

  • @FabianRaygosa
    @FabianRaygosa 3 года назад +1

    I did something similar. I created a column. I nasty huge big if else that said if 0 - 10 = "0-10" elseif 11 - 20 = "11-20" so on so on. Then I made a slicer on that column and it worked just fine. Filtered based on "ranges".

  • @MrAszpic
    @MrAszpic 3 года назад

    Very elegant, thanks for sharing!

  • @justinsanders497
    @justinsanders497 3 года назад +1

    I had a similar problem where I needed to create a dynamic filter without using the filter pane. An alternate solution was to use a What if Parameter and then SelectedValue() to filter based off what the user typed in. Overall very similar process but the end users can now filter by whatever value their heart desires.

    • @ACastilloYT
      @ACastilloYT 3 года назад

      Hi justin, have you posted this in any site? I would like to watch in detail! Thanks in advance!

    • @justinsanders497
      @justinsanders497 3 года назад

      @@ACastilloYT Sorry, No I don't have any posts anywhere. I am just a fan of #GuyInACube.

  • @mdhidayat5706
    @mdhidayat5706 3 года назад +5

    Thanks Scott for raising the hard question 😂

  • @anisnaim4947
    @anisnaim4947 3 года назад

    Nice move !!! thank you

  • @rerangelt
    @rerangelt 3 года назад

    Whaaaat! That was genius!! Love this channel. Grettings from Colombia

  • @janostoth6306
    @janostoth6306 3 года назад

    Absolutely brilliant!

  • @mohsenbenromdhane7643
    @mohsenbenromdhane7643 3 года назад +1

    Hi Patrick you are more efficient to create the filter table using Enter data it should be some way to script it

  • @AlbertoGastaldo
    @AlbertoGastaldo 3 года назад +1

    Hi Patrick, nice solution actually.
    Many users would like to have different usability. They want a slicer with (continuous) numerical values so they can choose whatever number interval ( so... between 1234 and 69493839).
    That is not possible at the moment and I think this is what most people would like to have.

  • @milenatarka8388
    @milenatarka8388 3 года назад +1

    Thank you for the great video, but I have one more question. While choosing for example

    • @przemekkoska83
      @przemekkoska83 3 года назад

      Hi Milena
      I would modify the disconnected table to have two value columns let's say 'Value from' & 'Value to' and then in the measure create two variables
      VAR _filtervaluefrom = SELECTEDVALUE ( 'Measure Filter'[Value from] ) and
      VAR _filtervalueto = SELECTEDVALUE ( 'Measure Filter'[Value to] ).
      Last thing is to amend the SWITCH statement in the first line as follows
      AND ( _currentsalesamount >= _filtervaluefrom , _currentsalesamount

  • @HarisKhan-kq6ih
    @HarisKhan-kq6ih 3 года назад +2

    Hello! Great Solution, What about the Total of filtered values? It was not there. Kindly explain How can we have Totals of filtered values in the table?

    • @dhruvinshah4817
      @dhruvinshah4817 3 года назад

      Workaround would be to add a card to show the total for summarized measure.

    • @NirRobinson
      @NirRobinson 3 года назад

      You can have if has one valve and use the original measure

    • @TheCraigie007
      @TheCraigie007 3 года назад

      ## Total Sales Amount Filtered =
      VAR SlicerSelection =
      SELECTEDVALUE( 'Slicer Table'[Value] )
      VAR CurrentSalesAmount = [Sales Amount]
      VAR Result =
      IF(
      ISINSCOPE( 'Product'[Product Name] ) ,
      SWITCH(
      TRUE() ,
      CurrentSalesAmount

  • @Suraj-vz4jc
    @Suraj-vz4jc Год назад

    Hi Adam and Patrick.
    I have one question in dax
    Can we do dynamic measures selection in power BI.
    - users the option of choosing a specific measure for display in visualization?

  • @sarojkumarmaharana3906
    @sarojkumarmaharana3906 2 года назад

    @Patrick, This is helpful. Whenever I hit a roadblock I get some or other guidance from your blogs. But, today I have a unique ask. I have created the slicer panel with bookmarks following your blogs. Now, the user requirement is that "how to close the slicer panel automatically after selection"? To simplify, when user's cursor remain over the slicer panel it will stay pop out and give the facility to select whatever the user wants to select, but when he is done and hovers out of the slicer pane, the slicer pane should should disappear. Can this be done?

  • @mnowako
    @mnowako 3 года назад

    Excellent solution 👍 Bravo 👏

  • @sarajvo2010
    @sarajvo2010 3 года назад

    Great and simple solution. I was just looking similar solution for power pivot, Excel simple model: how to exclude 0 (zero amount).
    This solution could be adjusted how to exclude 0 (zero amount)?

  • @vedantdashora2528
    @vedantdashora2528 2 года назад

    Thank you for this video, can you please make a video on how can we create a Dax table derived from one of our existing table in PBI; and the dax table is getting filtered dynamically by using some filter condition like ColumnValue in selectedvalue(column). Please guide alternative approaches

  • @catherinegould6662
    @catherinegould6662 3 года назад +2

    Great video! I have implemented something similar. 😊
    I note when you apply BLANK() to any measure, that you then do not get a total in a matrix visual ... can you amend the measure so that you can? ie. possibly using a dax generated table instead with filter rather than switch true??

    • @NickRiethovenNP
      @NickRiethovenNP 3 года назад +1

      Good question. Maybe if you replace the Blank() with 0 and in the filter pane add: the created metric > 0. Should do the trick

    • @yevhen486
      @yevhen486 2 года назад

      Have you found solution how to handle with totals?

  • @ACastilloYT
    @ACastilloYT 3 года назад

    Hi Patrick, it's works very well with just two columns, I've tried in a table with several columns and I think I would need to relate tables right?

  • @apr4608
    @apr4608 3 года назад

    Hello Patrick, How can we get the totals on the Visuals? I'm trying it on a matrix

  • @Bharath_PBI
    @Bharath_PBI 3 года назад

    Thank you. Since no relationship, it doesn't work with drill through to the detail page.

  • @vaibhavnajan2
    @vaibhavnajan2 3 года назад

    Hello Patrick , how can we add multiple slicers using the same Measure column?

  • @ncbshiva
    @ncbshiva 3 года назад +1

    Hi Adam, Excellent solution, how can i make sure that i get the grand total also to be displayed ?

    • @PeterKontogeorgis
      @PeterKontogeorgis 3 года назад

      Add a test using hasonefilter() or something similar and if it returns false then return the total.

    • @Darko8997
      @Darko8997 3 года назад +2

      You'll have to create a new measure like this: Measure 2 = SUMX(SUMMARIZE(table_x,table_x'[Product Name],"_1",[Total Sales Amount Filters]),[_1]) and use this measure in the table instead of the measure called Total Sales Amount Filters which Patric used in the video. This will give you the grand totals when using the slicer.

    • @TheCraigie007
      @TheCraigie007 3 года назад +1

      ## Total Sales Amount Filtered =
      VAR SlicerSelection =
      SELECTEDVALUE( 'Slicer Table'[Value] )
      VAR CurrentSalesAmount = [Sales Amount]
      VAR Result =
      IF(
      ISINSCOPE( 'Product'[Product Name] ) ,
      SWITCH(
      TRUE() ,
      CurrentSalesAmount

  • @9513698741
    @9513698741 3 года назад +1

    Hi Patrick Thanks for all the explanations and videos
    They are a huge help for me
    a question:
    I want to perform a calculation that is conducted according to an index table
    For example, if the employee's efficiency is between 85% and 95%, reward him with $ 70
    If the efficiency of an employee is between 95% and 100% $ 100 this month
    My efficiency is a measure
    I know it can be done with the switch function
    But the index and amounts change once a year so it is easier to maintain in the table than in the function within the report
    Is there a way ?????

  • @MatthiasK-qp9bf
    @MatthiasK-qp9bf 3 года назад +1

    @Patrick: How to enable the grand total in this case (for all amounts shown)?

    • @Darko8997
      @Darko8997 3 года назад +1

      You'll have to create a new measure like this: Measure 2 = SUMX(SUMMARIZE(table_x,table_x'[Product Name],"_1",[Total Sales Amount Filters]),[_1]) and use this measure in the table instead of the measure called Total Sales Amount Filters which Patric used in the video. This will give you the grand totals when using the slicer.

    • @MatthiasK-qp9bf
      @MatthiasK-qp9bf 3 года назад

      @@Darko8997 Thx. I had a suspicion on SUMX, you confirmed it. Great!

  • @santoshraghunath8133
    @santoshraghunath8133 3 года назад

    Thanks Patrick. How do you handle totals in this? Also, if I have to keep both the measures with and without filters and do not show blanks, how do I do that?

  • @clifordakoyo406
    @clifordakoyo406 3 года назад

    how do you make an overall risk visual of conservative, moderate and aggressive visuals?

  • @rupeshbeyondtodisability
    @rupeshbeyondtodisability 3 года назад

    Same trick i used earlier in one of my dashboard

  • @madiakns
    @madiakns 3 года назад

    could same result have been achieved using calculated groups?

  • @adarshr6403
    @adarshr6403 3 года назад

    Thanks Scott 😀👍🙏

  • @Sky_Hi_View_ZA
    @Sky_Hi_View_ZA 3 года назад

    Will Smith! This is the only method that has worked for me. This really really helped me out! Thank you for this my brother!

  • @TimKraai
    @TimKraai 3 месяца назад

    How could this be adapted for a Matrix? The issue I am having is that the totals of the matrix are still counting the blank rows. I tried to filter out the blank rows with SUMX but this becomes really slow. Is there a more performant way to have the totals be correct when filtering the matrix by a range bucket?

  • @chitraxi1
    @chitraxi1 3 года назад

    Can you do a video please do a video on market data analysis. How can we compare different employees with their respective market data.

  • @jurgennooren
    @jurgennooren Год назад

    Hi Guys, really like your videos, really helpfull. Would you perhaps know if it's possible to rotate (90 degrees counter clockwise) the headers in a matrix?

  • @anuragbawankar685
    @anuragbawankar685 Год назад

    Thanks a lot !!!

  • @niranjanreddy7286
    @niranjanreddy7286 2 года назад

    Hi Patrik,I really loved your videos. I have a question
    I have two different calendar tables that used for different visuals in the same page,
    1st calendar tables used in slicer for one visual
    2nd calendar table used as another slicer for second visual
    And both the calendar tables have no Relationship.
    suppose if i selected August month in 1 st slicer, in 2nd slicer should also automatically select Aug month, Is there a way to do that.
    Please help
    Thank you

  • @subashiyer3208
    @subashiyer3208 Год назад

    hi Patrick
    I have a slicer which has name of all salesperson however i need to display the graph or matrix only for the selected salesperson, that is when i choose a salesman from the slicer it should prompt for a password and then validate that and display data. Is this possible ..
    thanking you

  • @vbnmu
    @vbnmu 3 года назад

    Hi Patrick, I think adding a new column with an IF statement in Power Query could provide the same solution.

  • @sateeshkumarreddy117
    @sateeshkumarreddy117 3 года назад

    Hey Patrick, I have one question. I’ve done color formatting based on rules for a map but I want to show the color only for the selected criterion and the other should be shown with some default color

  • @NaveenKumar-hd3yg
    @NaveenKumar-hd3yg 3 года назад

    Hi
    In my dashboard have one table, one card , one slicer is there and my question is when i am selecting the slicer no need to change card only change table is it possible?, How ?.

  • @yarramneediravindraswamy6804
    @yarramneediravindraswamy6804 2 года назад

    i have one question, i have two or more tables with one column name like material_number, product_number,material_code these are all columns refering same data, how can i create slicer for this

  • @FYoshida
    @FYoshida 2 года назад

    Hi Patrick, do you have any video about how to filter calculated columns? I am getting crazy with this... HEEEELLPP!!!!

  • @nityanair3869
    @nityanair3869 3 года назад

    I want to use slicer selection as an input parameter for a stored procedure. I know how to use parameter in a dynamic execute query but I want to use slicker selection to be fed into stored procedure input parameter. Please please please someone help me here? I have been searching everywhere and did not get any solution.

  • @MeghanaRajanna-t4h
    @MeghanaRajanna-t4h Год назад

    Hi Patrick
    This one doesn't work for me for some reason..
    stuck!!

  • @arikohn1455
    @arikohn1455 3 года назад

    This answers a problem I'm trying to solve right now so amazing timing! Thanks Patrick. But I have another related question/problem: How would you slice by a DIFFERENT measure (not the same measure used in the table/visual)?
    So going back to your example, what if you wanted to slice your total sales by your total quantity or your total freight (might not make any sense business or analytically-wise but I hope the question makes sense)?

    • @scubax58
      @scubax58 3 года назад

      Not sure if I understood correctly, but from what I can see I’d use a calculation group.

  • @Art-tv7yu
    @Art-tv7yu 3 года назад

    Brilliant

  • @santoshraghunath8133
    @santoshraghunath8133 3 года назад

    Awesome 👍👍

  • @ashleytaaffe9423
    @ashleytaaffe9423 3 года назад

    Brilliant!

  • @alcazevedo
    @alcazevedo 3 года назад

    Hey Patrick, I have this situation: let's say I have sales by country (let's say, US, Canada, Spain), but 1 column per country. I want to be able to filter which country I need see in the table, but being able to see ech country individually, like: select US, have US column, if I select US and Canada, I'd like to see both columns with each country sales, not a total consolidated in 1 column.
    I have tried 2 solutions for this filter, none of them works for me. I tried a measure with a Switch function to show the sum of my selection, however, it shows all the countries data agregated in 1 single column. Other solution could be Unpivot columns, to have it all in the same column, then filter, but I have a huge model (MM of rows coming from DataBricks), so it's not a good option.
    Any suggestion how to handle this? 🤔
    Thanks,

  • @brendanobrien2253
    @brendanobrien2253 Год назад

    Has anyone done this with a date? Basically was something effective on a certain date or not?

  • @pivotstream6433
    @pivotstream6433 3 года назад

    Nice niceness! However... If I am working from Azure Analysis Services and use Embedded (which does not support a composite model) how could this work?

    • @dhruvinshah4817
      @dhruvinshah4817 3 года назад

      This can be done by creating the same form of a table in a different source and add that as a seperate query. For more on how to do it, check documentation.

  • @alexrosen8762
    @alexrosen8762 3 года назад

    Wow! Amazing :-)

  • @sateeshkumarreddy117
    @sateeshkumarreddy117 3 года назад

    Hello Patrick, I’ve a requirement and it’s complex to explain on chat. Let me know how to connect with you to discuss on this.

  • @fabiendelaloye6370
    @fabiendelaloye6370 3 года назад

    oh yeah !!

  • @ryanfisher5835
    @ryanfisher5835 3 года назад

    Brilliant! Just remember to keep using your genius for good and not evil Patrick. That's how Lex Luthor got started....

  • @MMHQ520
    @MMHQ520 3 года назад

    Thank you Scott 😊

  • @dariuszspiewak5624
    @dariuszspiewak5624 3 года назад

    This is another embodiment of the old adage in the programming world: "Every problem can be solved by adding another layer of indirection."

  • @shaileshsingh8906
    @shaileshsingh8906 3 года назад

    Hi Adam and Patrick ,I have an HR data by which I have created 3 matrix in power Bi, 1 for New employee ,2 for total number of employee
    3 for attrition , all three matrix have departments in rows and months in columns.
    Now for 2 matrix I have taken running total that add last month value and newly recruited employee in present month using calculate function ,this works fine but when I tried to subtract attrition values from above running total it start giving wrong result ,
    Ex :-If there is 1 attrition in any department in current month then my formula start subtracting 1 from each department and hence produce wrong result.
    please help in writing correct Dax function. Plz guys help me with this measure

    • @rrr9063
      @rrr9063 3 года назад

      would recommend the official forums as you can then also share screenshots of your model and tables. Think you could get this cleared up in an hour or so.

  • @BritonWells
    @BritonWells 3 года назад +1

    The animations are getting better and better..
    Patrick
    Patrick
    Patrick
    Patrick
    Patrick
    Cool solution. Could probably use calculation groups to make this work across any measure?

    • @johnnyw5627
      @johnnyw5627 3 года назад

      I had the same thought, and now I'm going down a rabbit hole figuring out if I can not only use a CG, but whether I could script the CG in C#. I guess though, there might be some scenarios where you don't want to apply the filter on all measures. If you had a table that showed Price, Cost and Profit and you wanted to filter by Profit < X, then you wouldn't want to then filter the other measures too... isn't gonna stop me going down this rabbit hole though!

  • @pavankumarreddy189
    @pavankumarreddy189 3 года назад

    Hi Patrick
    Based on "today date"
    I want to previous quarter end date.
    (I have no date table)
    Example
    Today date 19/05/2021
    I want to previous quarter end date
    For example
    31/03/2021.
    Please help me Patrick

    • @rupeshbeyondtodisability
      @rupeshbeyondtodisability 3 года назад

      Use switch funcation… ping me i will explain you

    • @rupeshbeyondtodisability
      @rupeshbeyondtodisability 3 года назад

      Use this DAX
      LastQtrDate =
      ---Get Last Qtr End Date By Today Date
      VAR MinusMonth =
      SWITCH (
      TRUE (),
      FORMAT ( TODAY (), "MMM" ) IN { "JAN", "APR", "JUL", "OCT" }, 1,
      FORMAT ( TODAY (), "MMM" ) IN { "FEB", "MAY", "AUG", "NOV" }, 2,
      FORMAT ( TODAY (), "MMM" ) IN { "MAR", "JUN", "SEP", "DEC" }, 3
      )
      RETURN
      EOMONTH ( TODAY (), - MinusMonth )

  • @VladMZ
    @VladMZ 3 года назад

    I think you guys never worked in logistics. Aging buckets/bins are a rave there, and I have solved this issue a year ago just in the same way shown here :) Aging reports are a usual thing in accounting, too - so this method applies there.

  • @igorpoleshchuk735
    @igorpoleshchuk735 3 года назад +1

    The major drawback is that you hide the Total.

    • @arklur3193
      @arklur3193 3 года назад

      You could write a measure (using SUMX(...)), that could sum the filtered values only but still show the Total. The drawback is that you do need to know that granularity level to which you apply the logic.

    • @BritonWells
      @BritonWells 3 года назад

      @@arklur3193 Yeah I can't think of a way to do this (calculate total) without having to define the grain beforehand

    • @igorpoleshchuk735
      @igorpoleshchuk735 3 года назад

      @@arklur3193 exactly

    • @Darko8997
      @Darko8997 3 года назад

      @@arklur3193 You'll have to create a new measure like this: Measure 2 = SUMX(SUMMARIZE(table_x,table_x'[Product Name],"_1",[Total Sales Amount Filters]),[_1]) and use this measure in the table instead of the measure called Total Sales Amount Filters which Patric used in the video. This will give you the grand totals when using the slicer.

  • @billcoleman2009
    @billcoleman2009 3 года назад

    Where's your total, Patrick? ;P

  • @seanleonard5907
    @seanleonard5907 3 года назад

    Ahh, that was his problem. He was using bing.

  •  3 года назад

    But where is the Total Patric? And how about a Remainder Row? And could you filter also by TOP N? 🤣😎