No video

Power BI - Dynamic Axes and Legends! (Easy)

  Рет қаралды 73,397

BI Elite

BI Elite

Күн бұрын

In this Power BI tutorial, we learn how to dynamically switch between categories within visual axes and legends! This is a fun trick that will add a lot of functionality for your end users.
To enroll in my introductory or advanced Power BI courses:
training.bieli...
PBIX:
www.dropbox.co...
Elite Power BI Consulting:
bielite.com/
Data Insights Tools:
www.impktful.com/
Connect with me on Twitter!
/ powerbielite

Пікірлер: 93
@gerardocanas5809
@gerardocanas5809 2 жыл бұрын
TIP: If you don't have a table for each category you can use DISTINCT when you create the table: legend_category = DISTINCT( UNION( SELECTCOLUMNS( 'data_gfk', "Category", 'data_gfk'[PROCESSOR], "Field", "CPU" ), SELECTCOLUMNS( 'data_gfk', "Category", 'data_gfk'[GPU MODEL], "Field", "GPU" ), SELECTCOLUMNS( 'data_gfk', "Category", 'data_gfk'[Gaming PCs], "Field", "Product Line" ) ))
@mahmoudjaafar9612
@mahmoudjaafar9612 3 жыл бұрын
Awesome! one of the rare videos that address this challenge in Power BI
@1989Bismillah
@1989Bismillah 3 жыл бұрын
Just followed this step by step and it works perfectly, thank you for such an intuitive walkthrough! looks really slick and professional.
@JuananAmunategui
@JuananAmunategui 3 жыл бұрын
Greatly appreciate this trick. This is by far the easiest and powerful way to achieve this result I've seen so far. Thank you very much!!
@BIElite
@BIElite 3 жыл бұрын
I like this one too! Thanks for watching
@weasel2393
@weasel2393 2 жыл бұрын
Really easy and worked first time. I added this tweak for my own needs: If you're using this for legends and you want one of the field options to be 'No Legend' you can create a dummy row where the 'Category' is set to a literal instead of a column name and then just leave out the USERELATIONSHIP part of the CALCULATE when this field is selected in the slicer.
@fabianeurich1124
@fabianeurich1124 Жыл бұрын
Could you explain this in detail? I don’t know how to add a new row into the Dax table. What’s the value in the category column?
@serban2743
@serban2743 2 жыл бұрын
Thank you. I struggled with dynamic legends and this really helped me!
@denizwhittier3869
@denizwhittier3869 3 жыл бұрын
My first BI Elite video - the quality is incomparable. I really enjoyed the discussion on why we would use an inactive filter over an active one and could definitely use more on this topic including the implications of cardinality in an inactive setting.
@DJALEXRRR
@DJALEXRRR 3 жыл бұрын
Oh wow! This is such a great tip, I nearly massively overengineered a solution until I saw this!
@abhishekstatus_7
@abhishekstatus_7 3 жыл бұрын
As always , You share really great tricks and tips on Power BI !! You are real guru Parker!! Thank a ton again.
@BIElite
@BIElite 3 жыл бұрын
Haha thank you abhishek! I appreciate you watching.
@brianmichael8032
@brianmichael8032 3 жыл бұрын
Can you explain why the many to one relationship with single cross filter direction is so important for this to work? When I initially tried this I didn't think to adjust the cardinality, assuming it would default to many to one, but it defaulted to One to One (which actually makes more sense to me). It wouldn't filter properly in that configuration.
@marlonholland955
@marlonholland955 3 жыл бұрын
How could we make the legend and x axis dynamic at the same time though?
@jonglassmusic5813
@jonglassmusic5813 3 жыл бұрын
I've been playing with this approach, and it works really well to control axis OR legend, but I can't figure out a way to control both (with two slicers obviously). Any ideas?
@samiraslan9735
@samiraslan9735 3 жыл бұрын
Simply epic, liked and subscribed! I have a question, do you think that this will work on huge data amount ?
@yash-vh9tk
@yash-vh9tk 3 жыл бұрын
Just what I am looking for. Thank you very much!
@BIElite
@BIElite 3 жыл бұрын
No problem!
@discrate
@discrate 3 жыл бұрын
Very useful content and this is not the first time :) I really like the crystal clear way you are presenting. Keep up the good work Parker!
@Krcmajster
@Krcmajster 3 жыл бұрын
Great stuff. I guess this would not be possible on a single table. E.g. one table where you have country, state, city (no drill down)
@BIElite
@BIElite 3 жыл бұрын
You could actually! Simply create inactive relationships on the same table multiple times, one for each column.
@zainqazi9502
@zainqazi9502 6 ай бұрын
Hey thanks for the tutorial , now my question is that how can we apply drilldown in the visuals using same technique
@luisvidal4930
@luisvidal4930 3 жыл бұрын
This is exactly what I've been looking for!!! However, this doesn't seem to play nice when other filters are placed on the page. Have you come across this issue? Any recommendations?
@MrAszpic
@MrAszpic 3 жыл бұрын
What do you think are the advantages/disadvantages of this method vs the one that does the annexes in the Power Query Editor, if any?
@BIElite
@BIElite 3 жыл бұрын
I wondered the same thing, and don't really have a strong opinion either way. Would love to hear your opinions on it.
@jbbaxter04
@jbbaxter04 3 жыл бұрын
I have issues with drillthrough using this method but do not with the index method.
@rickhehe
@rickhehe 2 жыл бұрын
Thanks a lot. Really like the USERELATHIONSHIP approach.
@jonglassmusic5813
@jonglassmusic5813 3 жыл бұрын
Man they make it hard to do what should be a simple switch, "color by X" now "color by Y". Thanks of the post though, great solution and work around for missing functionality.
@grzegorzstolecki
@grzegorzstolecki 3 жыл бұрын
Hello! Fine trick, but what about non unique values in LegendCategories[Category]? Then you will have many-to-many relationship between LegendCategories and the dimension table.
@BIElite
@BIElite 3 жыл бұрын
Interesting point! I didn't think about overlap between the categories. You could get around this by creating a new unique column that includes the category and value, though it might start to get messy.
@martinbubenheimer8480
@martinbubenheimer8480 3 жыл бұрын
If you run this solution in an environment with periodic data refresh it's mandatory to create unique keys. Otherwise you will never forget the day when Mr. Green was added as a customer to your model that allows to show products by color and customers by name ;-)
@DJALEXRRR
@DJALEXRRR 3 жыл бұрын
​@@BIElite I had this issue and yes, this works! I created the additional unique column that combined category+value column (seperated by a hyphen) and then set up the relationships using this unique column.
@Absolutenzo
@Absolutenzo 3 жыл бұрын
Excellent trick, works great! Is it possible to "reset the colors" for each Field? Because he tries to use 1 per Category per Field and it makes a lot of options (and so weird colors)!
@jeanramonyap2263
@jeanramonyap2263 Жыл бұрын
Does this only work if the categories are separated into different tables? I tried to do it with categories in the same table but I am unable to union them (step 1).
@frank6650
@frank6650 Жыл бұрын
Great video! In my dashboard there is Row Level Security (RLS) used. As the measures in the video make use of USERELATIONSHIP() and this is - afaik - not compatible with RLS. My question is if there is solution for dynamic axes and legends in combination with RLS? Any hints are much apreciated!
@benlewellyn
@benlewellyn 3 жыл бұрын
Would it be easy to leave in a Total option? If a user wanted to toggle between a total and a categorical legend, could you give them the option within the measure?
@500iq6foot8
@500iq6foot8 3 жыл бұрын
Is there a way to give the user the ability to toggle on and off fields in the value section of a matrix? As in, there is by default, Sales, Cost, and GM but the user can toggle one or the other off? There would leave the matrix just showing cost per month on the chart instead of Sales, cost, and GM
@pratafwd
@pratafwd 2 жыл бұрын
Excellent video. Can this be done with two values X axis? I want to switch between a month + day view to a year + week without using bookmarks and 2 charts (and without concatenating the two values)
@brianmichael8032
@brianmichael8032 3 жыл бұрын
I've got a follow up question for you. I'm trying to use this in a matrix visual (it works amazing) and obviously I am using something for both the row and column values. Would it somehow be possible to use this kind of dynamic axis for both the columns and the rows? I am thinking the answer is no because the measure that you use is clearly defining to use a particular relationship but maybe there is some work around that I just don't know about.
@seema_shahabkhan
@seema_shahabkhan 2 жыл бұрын
Thanks for sharing this
@BIElite
@BIElite 2 жыл бұрын
No problem at alL!
@r.d.1255
@r.d.1255 2 жыл бұрын
This is a really great tip, thanks so much. It works like a charm.
@strahan321
@strahan321 2 жыл бұрын
I am not sure what to put for the expression in my case for CALCULATE( EXP, USERRELATIONSHIP(.... If I want to show all items in the given category that is selected, what do i put here?
@toddtrimper9050
@toddtrimper9050 3 жыл бұрын
I'm getting the following error when creating the measure "A function 'SELECTEDVALUE' has been used in a True/False expression that is used as a table filter expression. This is not allowed." , how would I fix this?
@whitneymeyer5546
@whitneymeyer5546 2 жыл бұрын
I'm using to to change the axis to daily, monthly, qtrly. How can I add a sort order to the Variable code, since each slicer selection would need to be sorted differently?
@sergiizelenko4114
@sergiizelenko4114 3 жыл бұрын
Very interesting! Thank you for sharing! I'm sure that end users will love it :) I didn't fully understand why do you have blank values for the "Legend Category" when creating a filter? Can you please elaborate a bit more on that? (min 5:10 of the video)
@AshD1984
@AshD1984 2 жыл бұрын
I got around it by amending as follows Legend Catagories = DISTINCT( FILTER( Union( SELECTCOLUMNS( 'table', "Catagory", 'table'[column1], "Field", "label 1" ), SELECTCOLUMNS( 'table', "Catagory", 'table'[Supplier], "Field", "label2 " ) ) ,NOT(ISBLANK([Catagory]))) )
@danielliu1300
@danielliu1300 Жыл бұрын
No idea why it can be one-to-many relationship between the Legend table and category tables. it can only allow me to select many to one relationship between them.
@brookedrozdowicz2227
@brookedrozdowicz2227 3 жыл бұрын
This is great! Can you synch the y axis dynamically for all 3 visuals?
@ozcano1
@ozcano1 11 ай бұрын
Helo. I have seen and liked your solution. It is good, but I need a sollution that works fully like field parameters. That is I want to be able select (add and remove) any number of dimensions (multiple select) at the same time. Do you think that is possible? Regards
@HDREconomist
@HDREconomist 3 жыл бұрын
Would there be a way to identify a hierarchy this way as well?
@j.delarosa6390
@j.delarosa6390 3 жыл бұрын
That was so useful for me. Thanx
@chriscringle8672
@chriscringle8672 3 жыл бұрын
I tried to set this up using the filled map visual and it gave an error saying it couldn't determine the relationship. I tried setting the measure I set up with the calls to USERELATIONSHIP on the "tool tips" well but it made no difference when i had the relevant slicer entry selected. only when i forced the relationship to be enabled would it work. any idea on how to get this to work with the filled map?
@adeelnazir5709
@adeelnazir5709 3 жыл бұрын
Can we show variance in Percentage and amount based on selection. If yes then please guide right way. Because we can only show single formatting over bars i think so.
@jackcoxsmith
@jackcoxsmith 3 жыл бұрын
Is there a way to be able to do this with a live connection? We have most of if not all our reporting in BI using tabular models so wouldn't be able to create a custom table unless it was directly in the database.
@ElGuerreroMaya
@ElGuerreroMaya Жыл бұрын
For some reason Power BI didn't let me stablish the correct many-to-one relationship, which means it only allowed me to use the category tables to filter what in the video would be the "LegendCategories" table, it took me a while to figure out how to solve this and had to end up allowing bi-directional filtering (which I hate to do) to be able to do this
@frank_hw
@frank_hw 2 жыл бұрын
brilliant stuff mate!
@zchase6631
@zchase6631 3 жыл бұрын
thx for this. But how do drill-through with this?
@sbmrdeo
@sbmrdeo 3 жыл бұрын
As always, it's awesome. loved it.
@BIElite
@BIElite 3 жыл бұрын
Glad to hear, Ramesh :)
@rajatsharma6088
@rajatsharma6088 3 жыл бұрын
Amazing work...really awesome ! will this work if new values are added in the source table for the 'CustomerCategoryName' or 'StateprovinceName' or 'ColorName' ? ASAIK calculated tables/columns take the values as such when they are created, they don't update after creation.
@BIElite
@BIElite 3 жыл бұрын
Hey Rajat, yes if more values are added to the DIM tables, the calculated table will grow as well! Calculated tables are recalculated at the end of the data load process, so it will work just fine :)
@zleahy
@zleahy 3 жыл бұрын
Having trouble with my relationship from LegendCategories table to other tables. I essentially have an Invoice Master table linked to a Office Master table based on sales office # (many to one). In my Office Master I have office # > office name > market > and region as fields. These are the fields I added as my categories. I am trying to link the LegendCategories table to the Office Master on the many to one relationship. For some reason when I attempt to add a relationship, many to one is not an option. I am trying to create a dynamic legend based on office, market, and region. Any guidance would be greatly appreciated!
@SuperLeena79
@SuperLeena79 3 жыл бұрын
I have the same issue, since my categories have the same value repeated under multiple fields, I cannot get a Many to One relationship. Any help around this issue would be appreciated. I will have to resort to bookmarks in the meantime!
@lucassilvanogueiragomes6621
@lucassilvanogueiragomes6621 2 жыл бұрын
I'm having a problem with circular dependency when I try to connect both tables. Did anyone get the same trouble?
@altarazul2
@altarazul2 2 жыл бұрын
I need to do something like this but with 3 columns in the same table, my table has 3 diferent status columns so i want to change the legend in the stacked bars chart using an slicer with the name of the 3 columns.
@EricaDyson
@EricaDyson 3 жыл бұрын
Lovely! Really neat. Thanks so much for sharing. Will definitely give this a go :-)
@BIElite
@BIElite 3 жыл бұрын
Glad to hear, Erica!
@noahsitu8126
@noahsitu8126 3 жыл бұрын
Hey, just a quick question, how to remove duplicated item in Category column? Thanks
@mbelmer85
@mbelmer85 3 жыл бұрын
Wrap the table in a DISTINCT() so LegendCategories = DISTINCT(UNION(...
@noahsitu8126
@noahsitu8126 3 жыл бұрын
@@mbelmer85 Thanks a bunch!
@abolitupe8325
@abolitupe8325 3 жыл бұрын
Amazing.. thank you👍
@BIElite
@BIElite 3 жыл бұрын
No problem, Aboli!
@bilhanbel3487
@bilhanbel3487 Жыл бұрын
can we control the colors ? please anyone ?
@Xploit_GG
@Xploit_GG 3 жыл бұрын
Super Content As Always...Way to go
@BIElite
@BIElite 3 жыл бұрын
Thank you Rahul!
@totvabe1
@totvabe1 3 жыл бұрын
Brutal !!!
@ashishmohan4707
@ashishmohan4707 3 жыл бұрын
wow great amazing super
@BIElite
@BIElite 3 жыл бұрын
Thanks ashish!
@crazybauns
@crazybauns 3 жыл бұрын
this works only if you have a snowflake schema
@zxccxz164
@zxccxz164 2 жыл бұрын
but you are stuck using TOTAL SALES measure!!! so it is only dynamic for ONE measure : ((((((((((((((((((((
@BIElite
@BIElite 2 жыл бұрын
You can always use a SWITCH measure or calculation groups. This video demonstrates dynamic categories, not measures.
@olivierdanhoffre5754
@olivierdanhoffre5754 3 жыл бұрын
Great, but no easy to understand. For training purposes, it would useful to have a table data with only one or tow columns, and for example only 1 criteria column, and with a downloadable .pbix. Most of PowerBi videos are in fact almost useless because they are too complex to show the important point.
@Baldur1005
@Baldur1005 3 жыл бұрын
That is perfect star schema ;) Just kidding... Useful video though
@BIElite
@BIElite 3 жыл бұрын
Haha see the other comment on using TREATAS instead of creating the inactive relationships. Then you're star schema only relies on the data source and not my silly hacks :)
Dynamic titles with multiple slicers or filters in Power BI
12:07
Guy in a Cube
Рет қаралды 134 М.
7 Days Stranded In A Cave
17:59
MrBeast
Рет қаралды 96 МЛН
а ты любишь париться?
00:41
KATYA KLON LIFE
Рет қаралды 3,6 МЛН
🚨 YOU'RE VISUALIZING YOUR DATA WRONG. And Here's Why...
17:11
Adam Finer - Learn BI Online
Рет қаралды 97 М.
Slicing by Measure Categories in Power BI
10:42
BI Elite
Рет қаралды 56 М.
Using DAX to control a chart range in Power BI
25:23
SQLBI
Рет қаралды 16 М.
Power BI - Dynamic Axis via Slicer (No DAX)
4:57
BI Elite
Рет қаралды 90 М.
How To Make a Drillthrough Page in Power BI
16:17
Pragmatic Works
Рет қаралды 7 М.
Get MORE out of Your BAR CHARTS in Power BI
18:09
How to Power BI
Рет қаралды 54 М.
Dynamically change chart axis in Power BI
9:00
Guy in a Cube
Рет қаралды 203 М.
Transforming a table into a fancy bar chart - Power BI
9:43
Data Pears
Рет қаралды 33 М.
7 Days Stranded In A Cave
17:59
MrBeast
Рет қаралды 96 МЛН