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

set constant line based on formula

Hi

 

I am trying to create two constant line:

1. based on main service average rate

2. based on peer / customer segment average rate

 

and these should not be affected by the filter i apply. 

 

I tried for item 1 the following

The output stays constant regardless on vessel direction filter and updated according when i change main service filter.

 

But this gets affected once I run filters on the slicers for customer segment and control party.  Is there a separate filter i should add on the syntax?

 

trade average = 
VAR t_ave =
    CALCULATE(
        [Rate],
        ALL(summary_table[Main Service], summary_table[vessel_direction]))
RETURN
    t_ave

 

filter.PNG

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @jeanL 

It is OK for [trade average] to use All() function, but the value returned is also affected by [Rate], you need to check the context of [Rate]. 

vxiaotang_0-1644478862085.png

For example, it works ok in the first picture, but if I set 'Table'[Column1]="a" in the second picture, then function All() in measure [test] won't work as expected.

vxiaotang_1-1644479373134.pngvxiaotang_2-1644479508017.png

 

Best Regards,

Community Support Team _Tang

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

amitchandak
Super User
Super User

@jeanL , In Visual format pane, In analytics pane you have an option for constant line, there you have an option for constant line, Ine new version you can give measure using fx. Try that out

 

Here I have used Margin % both as value and as constant line(Taken overall value)

amitchandak_0-1643949432249.png

 

HI @amitchandak 

 

I can set the constant line but how do i set it where it will not be affected by filter?

Helpful resources

Announcements
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.