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

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 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.

  • @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!

  • @RoshenRRujj
    @RoshenRRujj 3 ปีที่แล้ว

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

  • @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"

  • @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!

  • @crackerzin-bi6746
    @crackerzin-bi6746 3 ปีที่แล้ว

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

  • @mdhidayat5706
    @mdhidayat5706 3 ปีที่แล้ว +5

    Thanks Scott for raising the hard question 😂

  • @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".

  • @TainuiaKid1973
    @TainuiaKid1973 3 ปีที่แล้ว

    Awesome solution, great work Patrick.

  • @HarishS12137
    @HarishS12137 3 ปีที่แล้ว +1

    Exactly what I wanted, this is great 👍

  • @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.

  • @rerangelt
    @rerangelt 3 ปีที่แล้ว

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

  • @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.

  • @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.

  • @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!

  • @MrAszpic
    @MrAszpic 3 ปีที่แล้ว

    Very elegant, thanks for sharing!

  • @TimKraai
    @TimKraai 20 วันที่ผ่านมา

    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?

  • @mnowako
    @mnowako 3 ปีที่แล้ว

    Excellent solution 👍 Bravo 👏

  • @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

  • @anuragbawankar685
    @anuragbawankar685 11 หลายเดือนก่อน

    Thanks a lot !!!

  • @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

  • @janostoth6306
    @janostoth6306 3 ปีที่แล้ว

    Absolutely brilliant!

  • @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 ?????

  • @subashiyer3208
    @subashiyer3208 11 หลายเดือนก่อน

    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

  • @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?

  • @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

  • @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

  • @NaveenKumar-hd3yg
    @NaveenKumar-hd3yg 2 ปีที่แล้ว

    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 ?.

  • @sarojkumarmaharana3906
    @sarojkumarmaharana3906 ปีที่แล้ว

    @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?

  • @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

  • @alcazevedo
    @alcazevedo 2 ปีที่แล้ว

    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,

  • @anisnaim4947
    @anisnaim4947 3 ปีที่แล้ว

    Nice move !!! thank you

  • @adarshr6403
    @adarshr6403 3 ปีที่แล้ว

    Thanks Scott 😀👍🙏

  • @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?

  • @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?

  • @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.

  • @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?

  • @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)?

  • @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!

  • @MeghanaRajanna-t4h
    @MeghanaRajanna-t4h ปีที่แล้ว

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

  • @Bharath_PBI
    @Bharath_PBI 3 ปีที่แล้ว

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

  • @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

  • @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?

  • @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.

  • @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!

  • @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.

  • @clifordakoyo406
    @clifordakoyo406 3 ปีที่แล้ว

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

  • @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

  • @alexrosen8762
    @alexrosen8762 3 ปีที่แล้ว

    Wow! Amazing :-)

  • @FYoshida
    @FYoshida 2 ปีที่แล้ว

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

  • @rupeshbeyondtodisability
    @rupeshbeyondtodisability 3 ปีที่แล้ว

    Same trick i used earlier in one of my dashboard

  • @vaibhavnajan2
    @vaibhavnajan2 3 ปีที่แล้ว

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

  • @apr4608
    @apr4608 2 ปีที่แล้ว

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

  • @fabiendelaloye6370
    @fabiendelaloye6370 3 ปีที่แล้ว

    oh yeah !!

  • @brendanobrien2253
    @brendanobrien2253 ปีที่แล้ว

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

  • @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

  • @ryanfisher5835
    @ryanfisher5835 3 ปีที่แล้ว

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

  • @madiakns
    @madiakns 3 ปีที่แล้ว

    could same result have been achieved using calculated groups?

  • @vbnmu
    @vbnmu 3 ปีที่แล้ว

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

  • @ashleytaaffe9423
    @ashleytaaffe9423 3 ปีที่แล้ว

    Brilliant!

  • @Art-tv7yu
    @Art-tv7yu 3 ปีที่แล้ว

    Brilliant

  • @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."

  • @santoshraghunath8133
    @santoshraghunath8133 3 ปีที่แล้ว

    Awesome 👍👍

  • @GraceQiu520
    @GraceQiu520 3 ปีที่แล้ว

    Thank you Scott 😊

  • @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.

  • @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.

  • @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.

  • @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.

  • @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 )

  • @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

  •  3 ปีที่แล้ว

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

  • @seanleonard5907
    @seanleonard5907 3 ปีที่แล้ว

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