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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Rabi
Resolver I
Resolver I

fixed Average of a value when multiple dates are selected from slicer.

Hi,

 

I am calculating KPI for Actuals vs Target, the target and actuals are Average values and I get single value however as soon as i add KPI into the visual i get three different KPI whereas the KPI were to be calculated based on the average of actuals and target. I am trying to get KPI when multiple dates are selected from slicer. I also have different targets for different months. for example, in the table below I wanted to get a single KPI for average of target and average of Actual. I am using a date filter and Room Name filter in this table visual. 

Rabi_0-1693274978874.png

the KPI for this visual was supposed to be bad as the average of actual is over the  Average of target value.

 

How can i make sureto get a single KPI in this condition, i am using this kpi to format my Gauge Axis Visual. how to get a single value for Average of  Target and Actual when i select multiple or a single date from the slicer.

 

Thank you !

 

2 ACCEPTED SOLUTIONS

Hi @Anonymous ,

 

I was Expecting this result:

Rabi_0-1693449288815.png

Which is average of Target and Actual and KPI accordingly.

 

Thank You!!

View solution in original post

Rabi
Resolver I
Resolver I

Hi @Anonymous and All,

 

I figured out the solution myself, below is the DAX if you stumble upon same issues,

KPI =
VAR actual Sales=
    AVERAGE (Actual Sales)

VAR Lower Limit of Target =
    AVERAGE (Lower Limit of Target Sales)

VAR Target=
    AVERAGE (Target Sales)

RETURN
    IF (
        Actual Sales > Target Sales,
        "Bad",
        IF(
            AND(Actual Sales >= Lower Limit of Target Sales, Actual <= Target Sales),
            "Good",
            IF(
                Actual Sales< Lower Limit of Target Sales,
                "Low",
                BLANK()
            )
        )
    )

View solution in original post

4 REPLIES 4
Rabi
Resolver I
Resolver I

Hi @Anonymous and All,

 

I figured out the solution myself, below is the DAX if you stumble upon same issues,

KPI =
VAR actual Sales=
    AVERAGE (Actual Sales)

VAR Lower Limit of Target =
    AVERAGE (Lower Limit of Target Sales)

VAR Target=
    AVERAGE (Target Sales)

RETURN
    IF (
        Actual Sales > Target Sales,
        "Bad",
        IF(
            AND(Actual Sales >= Lower Limit of Target Sales, Actual <= Target Sales),
            "Good",
            IF(
                Actual Sales< Lower Limit of Target Sales,
                "Low",
                BLANK()
            )
        )
    )
Anonymous
Not applicable

Hi @Rabi ,

Can you please share some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Hi @Anonymous ,

 

I was Expecting this result:

Rabi_0-1693449288815.png

Which is average of Target and Actual and KPI accordingly.

 

Thank You!!

Anonymous
Not applicable

HI @Rabi,

In fact, I want some dummy data and the expression that you used to test. They will help us clarify the data table structure and test to coding formula to create visualizations. (you can create in excel and paste in thread with table format)

BTW, did these three fields from different expressions and use on the matrix value fields?

If that is the case, you can create a new table these field names and use on matrix column. Then you can write a formula with switch function to check current column value and redirect to different measure expressions to show on the matrix.

Regards,
Xiaoxin Sheng

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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