March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Everyone,
I have a clustered column chart (below) that shows Revenue (light blue) and Margin (dark blue) over the span of a few years. This data is taken from 10,000 rows along with multiple filters. I am curious how I can calculate the percentage (margin/revenue) between these two final columns and show it on a secondary axis as a line chart in Power BI.
Any help would be great!
Solved! Go to Solution.
Hi @Anonymous ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure
SUMX(
FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&'Table'[Group]=MAX('Table'[Group])),[Value])
Measure 2 =
var _revenue=
SUMX(
FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&'Table'[Group]="Revenue"),[Value])
var _margin=
SUMX(
FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&'Table'[Group]="Margin"),[Value])
return
DIVIDE(_margin,_revenue)
2. Select Line and clustered column chart visual, place [Measure] to Column y-axis, [Measure2] to Line y-axis.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure
SUMX(
FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&'Table'[Group]=MAX('Table'[Group])),[Value])
Measure 2 =
var _revenue=
SUMX(
FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&'Table'[Group]="Revenue"),[Value])
var _margin=
SUMX(
FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&'Table'[Group]="Margin"),[Value])
return
DIVIDE(_margin,_revenue)
2. Select Line and clustered column chart visual, place [Measure] to Column y-axis, [Measure2] to Line y-axis.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |