cancel
Showing results for 
Search instead for 
Did you mean: 
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


View solution in original post

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
Super User IV
Super User IV

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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Kudoed Authors