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
FernandoOliveir
Frequent Visitor

Get a target by client in each row

Hello everyone!

 

I have a table with operational result by client as you can see bellow:

 

FernandoOliveir_1-1675951757306.png

FernandoOliveir_2-1675952323617.png

 

 

At the momment the target is 15% for all of clients because it's the target of the segment, but my manager need to see a specific target per client. Is it possible?

 

I mean: 

For first client the icon target will be:

Bellow 8% will be green

8-9% will be yellow

10 or more will be red

 

For second client the icon target will be:

Bellow 18% will be green

18-19% will be yellow

20 or more will be red.

 

Thanks.

 

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

Hi @FernandoOliveir ,

 

You can create a measure for conditional formatting.

For example,

Color = 
VAR _per =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALLSELECTED ( 'Table' ), [Client] = MAX ( 'Table'[Client] ) )
    )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Table'[Client] ),
        "Client 1",
            IF (
                _per < 0.08,
                "CircleHigh",
                IF ( _per >= 0.08 && _per <= 0.09, "CircleMedium", IF ( _per > 0.10, "CircleLow" ) )
            ),
        "Client 2",
            IF (
                _per < 0.18,
                "CircleHigh",
                IF ( _per >= 0.18 && _per <= 0.19, "CircleMedium", IF ( _per > 0.20, "CircleLow" ) )
            )
    )

vstephenmsft_0-1676015211468.png

vstephenmsft_1-1676015229173.png

 

 

Reference: Tips on displaying icons based on field values in ... - Microsoft Power BI Community

 

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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
v-stephen-msft
Community Support
Community Support

Hi @FernandoOliveir ,

 

You can create a measure for conditional formatting.

For example,

Color = 
VAR _per =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALLSELECTED ( 'Table' ), [Client] = MAX ( 'Table'[Client] ) )
    )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Table'[Client] ),
        "Client 1",
            IF (
                _per < 0.08,
                "CircleHigh",
                IF ( _per >= 0.08 && _per <= 0.09, "CircleMedium", IF ( _per > 0.10, "CircleLow" ) )
            ),
        "Client 2",
            IF (
                _per < 0.18,
                "CircleHigh",
                IF ( _per >= 0.18 && _per <= 0.19, "CircleMedium", IF ( _per > 0.20, "CircleLow" ) )
            )
    )

vstephenmsft_0-1676015211468.png

vstephenmsft_1-1676015229173.png

 

 

Reference: Tips on displaying icons based on field values in ... - Microsoft Power BI Community

 

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

Worked perfctly, but i have forget of a specific case.

I have one client that have four differents operations, and that ramification uses another value in the same table. I tried to adjust the DAX using chatgpt, but i couln't.

 

Thanks for the support and sorry for the delay to reply. I was working in others projetcs and only now back to this one.

 

Example: 

FernandoOliveir_0-1689095570188.png

 

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.