Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
monika_todor
Advocate II
Advocate II

MINX used in Matrix provides incorrect subtotal

Hi All,

I'm working on a report where the value I need to see on a subtotal level (for vreme) is the minimum value for the column in the matrix which in this example is -12.901.652, instead of -61.952.817 (which in this case is the summed value of the column).

monika_todor_0-1702648641421.png

The challenge is that the MIN value for each time is calculated based on 2 columns in 2 different data sources (which can't be merged): SUM(VkupnoPobaruva[Iznos]) - SUM(VkupnoDolguva[Iznos] hence I can't add a new column instead the measure.

Thank you in advance!

Best,

Monika

1 ACCEPTED SOLUTION

Thank you, I found a solution by inserting new data sources and changing the relationships in the model.

View solution in original post

4 REPLIES 4
monika_todor
Advocate II
Advocate II

Thank you Dino for your detailed response, much apprecited!

The thing is that the relationship model is much more complex. Both sources 'VkupnoPobaruva' and 'VkupnoDolguva' are related through DimVreme (for Time) and DimDatum (for date) which means that in none of the tables 'VkupnoPobaruva' and 'VkupnoDolguva' has all the dates and times from the other table, so adding a new column in one of these tables can't solve the problem as there may be rows missing.

Anonymous
Not applicable

Hi @monika_todor ,

Can you provide your data model? Replace your original data with test data so that you can avoid data security breaches. I can't reproduce complex models by creating them manually, thanks!

Best Regards,
Dino Tao

Thank you, I found a solution by inserting new data sources and changing the relationships in the model.

Anonymous
Not applicable

Hi @monika_todor ,

You mentioned that your two data sources could not be merged, I would like to inquire if there is some sort of one-to-one or one-to-many relationship between VkupnoPobaruva and VkupnoDolguva?
If it exists, you can try this DAX to create a new column in one of the tables:

Column = 
VAR Value2 = 
CALCULATE(
    MAX('VkupnoPobaruva'[Iznos]),
    FILTER(
        'VkupnoPobaruva',
        'VkupnoPobaruva'[time] = 'VkupnoDolguva'[time]
    )
)
RETURN
'VkupnoDolguva'[Iznos] - Value2

vjunyantmsft_0-1702865488945.pngvjunyantmsft_1-1702865498421.png

Then put this column into the matrix:

vjunyantmsft_2-1702865579890.png

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.