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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
vincentllx
Regular Visitor

Constant Threshold calculation

Hi, 

I'd like to calculate a threshold as follow (using a measure) : I have 13 periods in a a year, but I only use the first 5 to calculate the mean. Once I put this measure in the visualisation, I d'like to have a constant, but rather I have a fluctuating line.

Why ? And how can I have a constant instead ?

Moy2019 = CALCULATE(COUNT('2020 - 2022'[NoEvenement]),'2020 - 2022'[Année financière]="2019-2020",'2020 - 2022'[Période]<6)/5

All the data comes from a single table. 

Please note that I've simplified the DAX function : At the end I need to have a superior and inferior threshold (so i'll have to measure).

Let me know if you need any further information.

VincentCapture d’écran 2022-03-08 à 16.28.20.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @vincentllx ,

Please update the formula of your measure [Moy2019] as below and check whether you can get your expected result.

Moy2019 =
DIVIDE (
    CALCULATE (
        COUNT ( '2020 - 2022'[NoEvenement] ),
        FILTER (
            ALLSELECTED ( '2020 - 2022' ),
            '2020 - 2022'[Année financière] = "2019-2020"
                && '2020 - 2022'[Période] < 6
        )
    ),
    5
)

yingyinr_0-1646982998448.png

If the above one still can't help you the expected result, please provide some sample data in the table '2020-2022' and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file with me. Thank you.

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @vincentllx ,

Please update the formula of your measure [Moy2019] as below and check whether you can get your expected result.

Moy2019 =
DIVIDE (
    CALCULATE (
        COUNT ( '2020 - 2022'[NoEvenement] ),
        FILTER (
            ALLSELECTED ( '2020 - 2022' ),
            '2020 - 2022'[Année financière] = "2019-2020"
                && '2020 - 2022'[Période] < 6
        )
    ),
    5
)

yingyinr_0-1646982998448.png

If the above one still can't help you the expected result, please provide some sample data in the table '2020-2022' and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file with me. Thank you.

Best Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.