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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Chris_23
Helper II
Helper II

Counting the rows where the value is greater than a benchmark

Hi,

 

I want to get the number of rows where the offer of a selectedvalue is higher compared to the benchmark "Fozzie Bear".

PBIX:

https://1drv.ms/u/s!AsLM3f2rQCP34xv34CARLr8vZ0bv?e=NNzvVi

 

For example, if I select "Rizzo the Rat", then Count = 1, since
Project MPS: Fozzie Bear 433,015 > Rizzo the Rat 316,426
Project Disney World: Rizzo the Rat 449,034 > Fozzie Bear 256,240

 

Chris_23_0-1673365793009.png

 

However, the Measure Count shows

Count = Calculate(COUNT('Table'[Job]),Filter('Table',calculate(MAX('Table'[Offer]),'Table'[Vendor]="Fozzie Bär") < calculate(MAX('Table'[Offer]),'Table'[Vendor]=selectedvalue('Table (2)'[Vendor]))))

= 2

 

Any idea what to improve?

 

Kind regards

Chris

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @Chris_23 ,

 

Please try:

Count =
VAR _a =
    SUMMARIZE (
        'Table',
        'Table'[Job],
        'Table'[Vendor],
        "Flag",
            IF (
                SUMX (
                    FILTER (
                        ALL ( 'Table' ),
                        [Job] = EARLIER ( 'Table'[Job] )
                            && [Vendor] = "Fozzie Bär"
                    ),
                    [Offer]
                )
                    < SUM ( 'Table'[Offer] ),
                1
            )
    )
RETURN
    IF ( ISFILTERED ( 'Table (2)'[Vendor] ), SUMX ( _a, [Flag] ) )

Output:

vjianbolimsft_0-1673403124304.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Chris_23
Helper II
Helper II

Hi @v-jianboli-msft ,

 

thanks a lot.

v-jianboli-msft
Community Support
Community Support

Hi @Chris_23 ,

 

Please try:

Count =
VAR _a =
    SUMMARIZE (
        'Table',
        'Table'[Job],
        'Table'[Vendor],
        "Flag",
            IF (
                SUMX (
                    FILTER (
                        ALL ( 'Table' ),
                        [Job] = EARLIER ( 'Table'[Job] )
                            && [Vendor] = "Fozzie Bär"
                    ),
                    [Offer]
                )
                    < SUM ( 'Table'[Offer] ),
                1
            )
    )
RETURN
    IF ( ISFILTERED ( 'Table (2)'[Vendor] ), SUMX ( _a, [Flag] ) )

Output:

vjianbolimsft_0-1673403124304.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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