Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey,
I have data from January to September of this year. I have a bar chart and would like a static line for the margin % for the whole year. I know how to do it for the entire company by creating a column, but then it doesn't change for drill downs. The issue is that I want it to change for the roles it is shared with. ie, I want the static line to be Region specific for the region it is shared with. I want the line to be District specific for the district I share with, not just the company margin. Please help. Thanks
Solved! Go to Solution.
@Anonymous
hello, to create a fixed margin:
Margin = DIVIDE ( CALCULATE ( SUM ( Table1[Sales] ), ALLEXCEPT ( Table1, Table1[Region], Table1[District] ) ) - CALCULATE ( SUM ( Table1[Cost] ), ALLEXCEPT ( Table1, Table1[Region], Table1[District] ) ), CALCULATE ( SUM ( Table1[Sales] ), ALLEXCEPT ( Table1, Table1[Region], Table1[District] ) ) )
@Vvelarde That works too - But why do we need the District?
Margin 2 = DIVIDE ( CALCULATE ( SUM ( Table1[Sales] ), ALLEXCEPT ( Table1, Table1[Region] ) ) - CALCULATE ( SUM ( Table1[Cost] ), ALLEXCEPT ( Table1, Table1[Region] ) ), CALCULATE ( SUM ( Table1[Sales] ), ALLEXCEPT ( Table1, Table1[Region] ) ) )
EDIT: You can actually revise mine to only this as well
Margin_Region = VAR RegionSales = CALCULATE ( SUM ( Table1[Sales] ), ALLSELECTED(Table1[Month]) ) VAR RegionCost = CALCULATE ( SUM ( Table1[Cost] ), ALLSELECTED(Table1[Month]) ) RETURN DIVIDE ( RegionSales - RegionCost, RegionSales )
@Anonymous Actually the more I test this the more I think you should go with this....
Margin_Region ALS = VAR RegionSales = CALCULATE ( SUM ( Table1[Sales] ), ALLSELECTED(Table1[Month]) ) VAR RegionCost = CALCULATE ( SUM ( Table1[Cost] ), ALLSELECTED(Table1[Month]) ) RETURN DIVIDE ( RegionSales - RegionCost, RegionSales )
Look the picture - you can test this with a matrix visualization - I think the above will give you what you are looking for
If you use Slicers andd a Month Slicer and select only a number of months this will adjust
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |