cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

How to do sum of a measure in Power BI matrix ?

Hi All,

 

I am trying to represent a measure in Matrix format and also want to represent total of measure of each row at the end of the matrix.

 

Measure   =

VAR A   =

     MAXX(Values('Table’ [id]),

       CALCULATE(MAX(‘Table’[Time of arrival]),

        FILTER('Table', [Is Active?]="Yes")))

 

RETURN

MAXX(

    Values(‘Table’ [id]),

    CALCULATE(MAX(‘Table’[person_number]),

    FILTER(’Table’, 'Table'[Time of arrival] = A)))

 

ACTUAL RESULT:

 

JAN

FEB

MAR

APR

MAY

JUN

Group A

1

 

2

4

5

6

Group B

4

5

3

5

 

7

TOTAL

1

 

2

4

5

7

 

EXPECTED RESULT :

 

JAN

FEB

MAR

APR

MAY

JUN

Group A

1

 

2

4

5

6

Group B

4

5

3

5

 

7

TOTAL

5

5

5

9

5

13

 

If you can provide your thoughts or views on this topic that would be really helpful.

Stay safe and healthy !

1 ACCEPTED SOLUTION
Super User IV
Super User IV

@ankbaner , Try a measure like

new meaure = sumx(values(Table[group]),[Measure])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Super User II
Super User II

Hi @ankbaner 

 

Try if this works, if not can you provide a data sample that is used for your matrix results

Measure = 
VAR __matrix =
    ADDCOLUMNS(
        SUMMARIZE( 'Table', 'Table'[id], 'Table'[month] ),
        "@maxTimeOfArrival", 
            CALCULATE( 
                MAX( 'Table'[Time of arrival] ),
                'Table'[Is Active?] = "Yes"
            )
    )

RETURN
CALCULATE(
    SUM( ‘Table’[person_number] ),
    TREATAS( 
        __matrix, 
        'Table'[id], 'Table'[month], 'Table'[Time of arrival] 
    )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Super User IV
Super User IV

@ankbaner , Try a measure like

new meaure = sumx(values(Table[group]),[Measure])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors