Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Measure shows wrong SubTotal in Matrix Visual

In a Matrix visual I need to display the amount of entries by year, nationality and day.
If I use the Value in my Matrix I get a correkt SubTotal as shown in green.

But since I will need to do some gowth calculations later on, I need to use a measure for that:

Measure = 
    CALCULATE( SUM(EntryTime_ALL[Value])
        ,EntryTime_ALL[Herkunft] = MAX(EntryTime_ALL[Herkunft])
        ,EntryTime_ALL[Tag] = MAX(EntryTime_ALL[Tag])
        ,EntryTime_ALL[Jahr] = MAX(EntryTime_ALL[Jahr])
    )

But by using a measure the SubTotal by "Tag" does not work properly and just takes the last value of the Rows. As shown in red.

enter image description here



Can someone please show me how to fix this?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

When it is doing the Total, it has no row context so using MAX will take the last/max value. Instead use IN similar to:

Measure = 
  CALCULATE(
    SUM(EntryTime_ALL[Value])
    ,EntryTime_ALL[Herkunft] IN DISTINCT(EntryTime_ALL[Herkunft])
    ,EntryTime_ALL[Tag] IN DISTINCT(EntryTime_ALL[Tag])
    ,EntryTime_ALL[Jahr] IN DISTINCT(EntryTime_ALL[Jahr])
  )
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading