This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello guys,
i have a complex situation i wish to help me with,
i have a line chart that have y axis of a measure = (profit/ PY profit), this line chart is been legend by item, so i could visualize all items in the same chart by line colors, now i'm trying to add line for a new measure b = calculate((profit/ PY profit), removefilters(item)), but i can't add any measure while the item is added to legend, any ideas?!!
Solved! Go to Solution.
To add a line representing the overall profit ratio (ignoring the item filter) to your line chart while keeping the legend for individual items, you can't directly add your measure B alongside the original measure when the item field is in the legend—Power BI will attempt to split measure B by item as well, leading to duplicated or incorrect lines.
Instead, use a disconnected table to create a custom legend that includes an "All Items" option, combined with a conditional measure that switches behavior based on the legend value.
This table will include all your existing items plus an "All Items" row. It won't be related to your main data model.
ItemLegend = UNION( VALUES('YourItemTable'[Item]), // Replace 'YourItemTable' with your actual table name containing the Item column ROW("Item", "All Items") )
This measure will calculate the item-specific ratio for individual items but switch to the overall ratio (ignoring item filters) for the "All Items" legend value.
Conditional Profit Ratio = VAR SelItem = SELECTEDVALUE(ItemLegend[Item]) RETURN IF( SelItem = "All Items", CALCULATE([Profit Ratio], REMOVEFILTERS('YourItemTable')), // Ignores item filters for the total line CALCULATE([Profit Ratio], 'YourItemTable'[Item] = SelItem) // Filters to the specific item )
This setup will display colored lines for each individual item (using the item-specific calculation) plus a separate line for "All Items" (using the overall calculation). You can customize the "All Items" line's color, thickness, or style in the visual's formatting pane to make it stand out (e.g., make it thicker or dashed).
To add a line representing the overall profit ratio (ignoring the item filter) to your line chart while keeping the legend for individual items, you can't directly add your measure B alongside the original measure when the item field is in the legend—Power BI will attempt to split measure B by item as well, leading to duplicated or incorrect lines.
Instead, use a disconnected table to create a custom legend that includes an "All Items" option, combined with a conditional measure that switches behavior based on the legend value.
This table will include all your existing items plus an "All Items" row. It won't be related to your main data model.
ItemLegend = UNION( VALUES('YourItemTable'[Item]), // Replace 'YourItemTable' with your actual table name containing the Item column ROW("Item", "All Items") )
This measure will calculate the item-specific ratio for individual items but switch to the overall ratio (ignoring item filters) for the "All Items" legend value.
Conditional Profit Ratio = VAR SelItem = SELECTEDVALUE(ItemLegend[Item]) RETURN IF( SelItem = "All Items", CALCULATE([Profit Ratio], REMOVEFILTERS('YourItemTable')), // Ignores item filters for the total line CALCULATE([Profit Ratio], 'YourItemTable'[Item] = SelItem) // Filters to the specific item )
This setup will display colored lines for each individual item (using the item-specific calculation) plus a separate line for "All Items" (using the overall calculation). You can customize the "All Items" line's color, thickness, or style in the visual's formatting pane to make it stand out (e.g., make it thicker or dashed).
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 27 | |
| 26 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 66 | |
| 36 | |
| 32 | |
| 26 | |
| 23 |