Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi all,
I am trying to make a graph that shows the % of a total cost for some of the components. This is done in a bar graph looking like this:
This works fine is just the fee. However once I add the legend to it it goes haywire:
It is only supposed to be showing the 5 cost elements used in the measure shown bellow:
Benchmarked Fee as % of Total =
Var _Fee =
CALCULATE(
SUM('d_Costs Data'[Value]),
'd_Costs Data'[Cost Element] = "Arch fee" ||
'd_Costs Data'[Cost Element] = "QS fee" ||
'd_Costs Data'[Cost Element] = "MEP fee" ||
'd_Costs Data'[Cost Element] = "PM fee" ||
'd_Costs Data'[Cost Element] = "Other Professional fee"
)
Var _AdjustedFee =
CALCULATE(
_Fee * DIVIDE(
[Selected Date Factor] * [Selected Location Factor],
10000
)
)
Return
DIVIDE( _AdjustedFee, [Benchmarked Value])
Where Selected Data and Location are used to benchmark the value so a chosen point. The Benchmarked Value is the total cost of the project at the chosen point. Cost data is a thin table with 3 columns, one is the key, the second is [cost element] which is the reason of the cost, and the third column is the value of the cost.
Basically, I only want the elements in the cost elements used in the dax measure to be shown.
@LocationUnknown , Add filter for all these. Example
Calculate(DIVIDE( _AdjustedFee, [Benchmarked Value]), filter( 'd_Costs Data',
'd_Costs Data'[Cost Element] in{ "Arch fee" ,"QS fee", "MEP fee" , "PM fee" ,"Other Professional fee" }))
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Hi @amitchandak Unfortunately that will not work as it will always equal 100% as you are filtering the denominator to be the same as the numberator.
Unfortunately I can not provide the data but this is what it lookes like;
| Project | Cost Element | Value |
Project 1 | Arch fee | 458 |
| Project 1 | QS fee | 987 |
| Project 1 | MEP fee | 6457 |
| Project 1 | MP fee | 416 |
| Project 1 | Other Professional fee | 4654 |
| Project 1 | Non fee cost 1 | 31254 |
| Project 1 | Non fee cost 2 | 4687 |
| Project 1 | Non fee cost 3 | 34556 |
| Project 1 | Not fee cost 4 | 41547 |
| Project 2 | Arch fee | 315 |
| Project 2 | QS fee | 345 |
| Project 2 | MEP fee | 398 |
| Project 2 | Other Professional fee | 756 |
| Project 2 | Non fee cost 1 | 31258 |
| Project 2 | Non fee cost 2 | 87654 |
| Project 2 | Non fee cost 4 | 32174 |
| Project 2 | Non fee cost 5 | 67656 |
| Project 3 | Arch fee | 897 |
| Project 3 | QS fee | 879 |
| Project 3 | MEP fee | 631 |
| Project 3 | MP fee | 543 |
| Project 3 | Other Professional fee | 489 |
| Project 3 | Non fee cost 1 | 65842 |
| Project 3 | Non fee cost 2 | 28569 |
| Project 3 | Non fee cost 3 | 15698 |
| Project 3 | Non fee cost 4 | 564161 |
The select date factor and select time factor are both arbitary integers. Obiously there are more records than in the table above.
Hi, @LocationUnknown
This is really weird, if you just add a field to legend, the range of X axis should not change.
Can you provide a simplified pbix file for further research?
Best Regards,
Community Support Team _ Eason
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |