Forum Discussion
Matrix Totals & Visual issue
- Anonymous8 months ago
Hi Msampedro ,
Thank you for reaching out to the Microsoft Fabric Community Forum.
After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. Fixed the measure for now.
I am including .pbix file for your better understanding, please have a look into it:
Thank you.
Hi Msampedro
Ensure both measures return numeric values in all contexts.
For the difference measure (Sales ACT vs Theorical), define as a proper measure:
Sales ACT vs Theorical =
[Actual Sales] - [Theorical Sales]
Use a combo chart:
X-axis = Date or Category
Column = Actual Sales
Line = Theorical Sales or Sales ACT vs Theorical
If still not visible:
Verify the data type in the model is numeric (Decimal Number / Whole Number)
Remove filters temporarily to check if slicers are hiding data
- Nabha-Ahmed8 months agoSuper User
1️⃣ Adapt “Actual Consumption” to show totals in a Matrix
The problem is usually that the measure works per row, but Power BI doesn’t automatically sum it at the total level. The solution is to detect whether you are at the row level or total level using HASONEVALUE() (or ISINSCOPE()), then calculate accordingly.
Pattern for totals:
Actual Consumption Total =
IF(
HASONEVALUE('Table'[Plant]), -- Or the field used for rows
[Actual Consumption], -- Your original row-level calculation
SUMX(
VALUES('Table'[Plant]), -- Iterate over all plants
[Actual Consumption] -- Sum the original measure
)
)Alternative using ISINSCOPE (modern approach):
Actual Consumption Total =
IF(
ISINSCOPE('Table'[Plant]),
[Actual Consumption],
SUMX(
ALL('Table'[Plant]),
[Actual Consumption]
)
)✅ This ensures the Matrix totals display correctly, summing across all plants or categories.
---2️⃣ Visualizing 3 measures correctly
Assuming your 3 measures are:
1. Actual Consumption
2. Theorical Sales
3. Sales ACT vs TheoricalStep 1: Choose the right chart type
Measure Recommended Visual Notes
Actual Consumption Column chart Displays absolute values per category (Plant, Date, etc.)
Theorical Sales Line or Column Use a combo chart with Actual Consumption as column, Theorical as line
Sales ACT vs Theorical Line or Bar (secondary axis optional) Can be plotted as difference line on the same combo chart---
Step 2: Use a Combo Chart for all 3 measures
1. X-axis: Category (Plant, Month, or Date)
2. Column values: Actual Consumption + Theorical Sales (stacked or side-by-side)
3. Line value: Sales ACT vs Theorical (difference measure)
4. Y-axis: You may use dual axis if scales differ
5. Formatting:Show data labels on columns
Use color coding: Blue = Actual, Grey = Theorical, Red = Difference
---
Step 3: Test measures individually
Always validate each measure using a Card visual.
Ensure all measures return numeric values, not blanks.
Once confirmed, they’ll render correctly in the combo chart.
---
Bonus Tip for Matrix Totals
If you also need Theorical Sales totals in the Matrix:
Theorical Sales Total =
IF(
ISINSCOPE('Table'[Plant]),
[Theorical Sales],
SUMX(
ALL('Table'[Plant]),
[Theorical Sales]
)
)Same logic applies to any calculated measure.
This pattern fixes totals for measures that are row-level calculations or calculated differences.
- Msampedro8 months agoHelper I
Thanks Nabha-Ahmed
Regarding the visual, I believe the issue is the "Theorical Sales" measure, as it seems not capable to be visualized. At the below capture you can see it is blank.
Theorical Sales = [Unique Qty]*SELECTEDVALUE('2. Renault Price List'[Price DAP €/kg])Let me know if any idea to solve it.
Thanks a lot!
Miguel