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
peterhui50
Helper III
Helper III

Is there a way to do this with a measure?

I have a visual here that contains 3 measures.

 

peterhui50_0-1664289733044.png

 

Company B and C are okay, sites 1 should far outperform sites 2 in those cases, so I don't need to flag them.

Company A is something I want to flag, sales for site 1 and 2 are too close. It's almost as if the sites made no difference.

 

Is there a way to do this in a measure? everything else are measures here,

Sales_Measure = SUM(Sales),

by_% is DIVIDE( Sales_Measure, CALCULATE(Sales_Measure , ALLEXCEPT(Table, Company)))

 

thanks! any help is greatly appreciated!!

 

 

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

Hi, @peterhui50 ;

Try it.

FLAG = 
VAR _DIFF=
CALCULATE(MAX('Table'[By_%])-MIN('Table'[By_%]),ALLEXCEPT('Table','Table'[Company]))
RETURN IF (ABS(_DIFF)<0.5,"Flag")

The final show:

vyalanwumsft_0-1664331688507.png


Best Regards,
Community Support Team _ Yalan Wu
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-yalanwu-msft
Community Support
Community Support

Hi, @peterhui50 ;

Try it.

FLAG = 
VAR _DIFF=
CALCULATE(MAX('Table'[By_%])-MIN('Table'[By_%]),ALLEXCEPT('Table','Table'[Company]))
RETURN IF (ABS(_DIFF)<0.5,"Flag")

The final show:

vyalanwumsft_0-1664331688507.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

johnt75
Super User
Super User

You could compare the value to a certain threshold with simple IF conditions, e.g.

Flag =
VAR SalesByPct = [by_%]
RETURN
    IF (
        (
            SELECTEDVALUE ( 'Table'[Site] ) = 1
                && SalesByPct <= 0.7
        )
            || (
                SELECTEDVALUE ( 'Table'[Site] ) = 2
                    && SalesByPct >= 0.3
            ),
        "Flag"
    )

You could also look into the various conditional formatting options.

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.