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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
laingm
Regular Visitor

Calculated Measure Filter with only Slicer

I am trying to plot a constant horizontal line on my chart that is the value of a measure (calculated as mean(x) + std(x)). The problem I am having is that I want the mean(x) and std(x) to be calculated over the entire time range of the chart. The chart has datetime on the x-axis. When plotting the measure as a value, it appears that the measure is calculated at each time point.

 

By using the ALL in CALCULATE when calculating the measure, I can get all of the datetimes to be used. The problem is that I also have a slicer that shortens the time window shown on the chart. If I use ALL, the slicer is not taken into account when calculating the mean or std (it still uses every datetime in the table).

 

Is there a way to have the calculation only use the slicer as a filter (and not the chart axis)?

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@laingm,

 

You may use ALLSELECTED Function to achieve it.

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

This does not appear to be working for me:

 

image.png

The calculated value (0.48) is the value I want the red line on the chart to be for the entire plot. Instead, the chart is recalulating the value at each time point on the plot. I want it to be static (horizontal) based on the time slicer for the entire page.

 

The calculation I am using is;

DIVIDE(CALCULATE(SUM(Events[Event Occurrences]), ALLSELECTED(CALENDAR[DateTime])),
        24. * CALCULATE(MAX(Events[DateTime])-MIN(Events[DateTime]), ALLSELECTED(CALENDAR[DateTime])) * CALCULATE(AVERAGE(Performance[Run %]), ALLSELECTED(CALENDAR[DateTime]))
    )

I have tried ALLSELECTED, but it has the same result.

@laingm,

 

Try to use ALLSELECTED ( Events[DateTime] ).

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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