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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Dylan24
Regular Visitor

Measure Calculation

Hi

@mahoneypat @watkinnc  

I hope you can assist please.
I have a measure (measeure error diff) that is calculating the difference between two measures, errors today minus errors yesterday.
The results can be zero, positive or negative numbers. 
Many say that one cannot sum a measure, is this true?
I am looking for a way to sum the values of a measure that are >0 and display this value in a Card.

So in a Card I would like to see the number 29 (7+6+6+5+5)

Dylan24_0-1627054478824.png

Could the below fourmula be modified?

POS_Error_Difference = COUNTROWS(FILTER('ICB Checks','ICB Checks'[MS_ICB_Error_Difference]>0))

Many Thanks
Dylan
1 ACCEPTED SOLUTION

@Dylan24 I figured those were measures but your pic doesn't show what column(s) are in the visual (so I gave generic Column1, Column2 solution.  Is there a Date column there?  If so, you would use that Date column in that SUMMARIZE (or if it's just one column, you can use DISTINCT or VALUES instead).

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

5 REPLIES 5
Dylan24
Regular Visitor

Hi Pat, 

 

Thank you for the feedback. 

 

I think I understand where you are going with the above formula, the only issue is that Yesterdays Errors and Todays Errors columns in the diagram are Measures, so when I try use your formula I dont have Table[Column1], Table[Column2] to add as they are measures and not identified when I search for them.

 

I have below the full table:

The Total Error Difference between the two measures (Today - Yesterday = 5) 
What I want is to create is a new measure that sums only the red flag items (items >0) 

Further down in this table there are also green flag items which show negative numbers. Although 5 is the correct Total difference the sum of the red flags only is also needed to show system exceptions produced daily.

This measure will than be added to a single card visualisation.

Thanks in advance.

Dylan24_0-1627283923888.png

 



@Dylan24 I figured those were measures but your pic doesn't show what column(s) are in the visual (so I gave generic Column1, Column2 solution.  Is there a Date column there?  If so, you would use that Date column in that SUMMARIZE (or if it's just one column, you can use DISTINCT or VALUES instead).

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Yes and "YES", I brought in the column that defines the flag and I have my number.
Thank you for the guidance 😀

Syndicate_Admin
Administrator
Administrator

I assume your measure doesn't show 29 already in your card.  If not, since your pic doesn't show which columns are in that visual (just the measures), the DAX patter you need is one like this

 

Total Errors vs Prev Days =
VAR summary =
    ADDCOLUMNS (
        SUMMARIZE ( Table, Table[Column1], Table[Column2] ),
        "cErrors", [MS_ICB_Error_Difference]
    )
RETURN
    SUMX ( FILTER ( summary, [cErrors] > 0 ), [cErrors] )

 

Pat

 

mahoneypat
Employee
Employee

I assume your measure doesn't show 29 already in your card.  If not, since your pic doesn't show which columns are in that visual (just the measures), the DAX pattern you need is one like this

 

Total Errors vs Prev Days =
VAR summary =
    ADDCOLUMNS (
        SUMMARIZE ( Table, Table[Column1], Table[Column2] ),
        "cErrors", [MS_ICB_Error_Difference]
    )
RETURN
    SUMX ( FILTER ( summary, [cErrors] > 0 ), [cErrors] )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors