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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
AllyT11
New Member

How to count positive and negative values of a measure

I have an 'On Target' measure that has been created from 3 separate tables - this is used on a matrix visual showing accounts/customers that are either on or below target.

 

Is there a way of doing a count of the accounts/customers that are on or exceeding their targets (all the positive values) and the same for negative values? Looking to show the % of accounts/customers that are on target vs those that aren't.

 

When I try adding a count measure the 'On Target' measure is not an option to select. Is this because already calculated measures cannot be used within another measure?

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

HI @AllyT11 
Please try

Count +ve =
COUNTROWS (
    FILTER (
        ADDCOLUMNS ( VALUES ( 'Table'[Customer Account] ), "@OnTarget", [On Target] ),
        [@OnTarget] > 0
    )
)
Count -ve =
COUNTROWS (
    FILTER (
        ADDCOLUMNS ( VALUES ( 'Table'[Customer Account] ), "@OnTarget", [On Target] ),
        [@OnTarget] < 0
    )
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

HI @AllyT11 
Please try

Count +ve =
COUNTROWS (
    FILTER (
        ADDCOLUMNS ( VALUES ( 'Table'[Customer Account] ), "@OnTarget", [On Target] ),
        [@OnTarget] > 0
    )
)
Count -ve =
COUNTROWS (
    FILTER (
        ADDCOLUMNS ( VALUES ( 'Table'[Customer Account] ), "@OnTarget", [On Target] ),
        [@OnTarget] < 0
    )
)

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.