Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have this kind of data:
Name | Position | Margin |
Dani | Proc | 9.2% |
Thomas | Sales | 62.4% |
Kate | Sales | 57.7% |
Kevin | Proc | 7.8% |
Judy | Sales | 29.2% |
Julius | Sales | 62.9% |
Brett | Proc | 92.3% |
Tom | OP | 17.1% |
Gisele | Sales | 69.6% |
Katie | Sales | 76.4% |
Hilary | Proc | 36.1% |
Don | OP | 91.1% |
Lucy | Sales | 69.3% |
Dani | Proc | 64.1% |
Thomas | Sales | 27.5% |
Kate | Sales | 79.8% |
Kevin | Proc | 63.3% |
Judy | Sales | 17.9% |
Julius | Sales | 13.1% |
Brett | Proc | 42.1% |
Tom | OP | 90.7% |
Gisele | Sales | 46.6% |
Katie | Sales | 86.6% |
Hilary | Proc | 28.9% |
Don | OP | 7.6% |
Lucy | Sales | 39.1% |
I'd like to add a new colum that shows the average Margin depending on the person's Position. After that I'd like to make a visualization that shows the avergage margin by name in columns and as constant horizontal lines the average margin by position. Is it possible to do this? Thank you very much for your support
Solved! Go to Solution.
Maybe exist another solution more easy but try with:
AVG-Margin-Proc = CALCULATE([Avg-margin],FILTER(ALLEXCEPT(Persons,Persons[Year],Persons[Quarter],Persons[Category],Persons[Country],Persons[Group]),Persons[Position]="Proc"))
modified the other measures like this with AllExcept
And Position in a slicer..Don't put in visual level filter.
hi @AldoMF
is possible to do.
first: Create a measure to obtain the average margin:
Avg-margin = AVERAGE(Persons[Margin])
next create a measure for each Position
AVG-Margin-OP = CALCULATE ( [Avg-margin], FILTER ( ALL ( Persons ), Persons[Position] = "OP" ) )
AVG-Margin-Sales = CALCULATE ( [Avg-margin], FILTER ( ALL ( Persons ), Persons[Position] = "Sales" ) )
AVG-Margin-Proc = CALCULATE ( [Avg-margin], FILTER ( ALL ( Persons ), Persons[Position] = "Proc" ) )
Finally in a line clustered column chart visual put the columns and measure in this way:
Hi @Vvelarde Thank you very much for your answer it worked perfect, however I made a mistake by not including all of the information. My data also contains Months, Years, Quarters, Category and Country, something like this:
Name | Position | Margin | Month | Year | Quarter | Group | Group | Category | Country |
Dani | Proc | 9.2% | Oct-15 | 15 | 4 | One | A | Europe | |
Thomas | Sales | 62.4% | Nov-15 | 15 | 4 | two | B | North America | |
Kate | Sales | 57.7% | Dec-15 | 15 | 4 | One | D | Asia | |
Kevin | Proc | 7.8% | Jan-16 | 16 | 1 | two | T | South America | |
Judy | Sales | 29.2% | Feb-16 | 16 | 1 | One | H | Oceania | |
Julius | Sales | 62.9% | Mar-16 | 16 | 1 | two | A | Africa |
When I used your solution, it showed me the total Margin average, but once I started playing with the visualizations and filtering the visualizations by country, year, quarter, etc. the lines didn't change their value. Is there a way in which I can have those same lines but they change their value as I filter the visualization? My visualization looks something like this:
Is there a way to make the values of the lines change as I filter the report?
Once again thank you for your help and support! You're awesome!
Hello from Guadalajara, Mexico 🙂
Hi @Vvelarde What if I just want to show in the Colums the people with Position "PC" but I need the three lines to still show in the graphs?
@Vvelarde I've done so and the other two lines dissapear because of the "ALLSelected" filter
Maybe exist another solution more easy but try with:
AVG-Margin-Proc = CALCULATE([Avg-margin],FILTER(ALLEXCEPT(Persons,Persons[Year],Persons[Quarter],Persons[Category],Persons[Country],Persons[Group]),Persons[Position]="Proc"))
modified the other measures like this with AllExcept
And Position in a slicer..Don't put in visual level filter.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
83 | |
78 | |
52 | |
38 | |
35 |
User | Count |
---|---|
93 | |
73 | |
55 | |
52 | |
46 |