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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
texnoi
Regular Visitor

KPI visualization from excel file

Dear all,
I am trying to create a simple training dashboarboard.

texnoi_0-1691225086707.png

So far it looks somehow working, but i fail to update the KPI visuals to work properly. 

This is how my database looks like in Excel (user hides the days when he did the training, but database is kept intact).

texnoi_0-1691224635106.png

 

This is how the target for the KPI visuals looks like (same database file, different tab):

texnoi_1-1691224678167.png

 

 

What i am failing to do is make the dashboard show the correct progression in the KPI visual.
If i put one item as manual measurement it works, but i need 47 measurements so that when i pick an item (exercise) its hows how far or after the KPI the user currently is.

texnoi_2-1691224814534.png

 


Attached are my files:
- Excel database: https://pixeldrain.com/u/rNUMkwzo
- PowerBi Dashboard: https://pixeldrain.com/u/cs9RUvcj

 

Thank you very much for your help in advance for any tips!
Warm regards,
Texnoi

1 ACCEPTED SOLUTION

I created two measures :

 

Dynamic Average = 
SWITCH(
    SELECTEDVALUE('Data v2'[Exercise]),
    "Box Squat", CALCULATE(AVERAGE('Data v2'[Reps3]),'Data v2'[Exercise]="Box Squat"),
     "BG Squat", CALCULATE(AVERAGE('Data v2'[Reps3]),'Data v2'[Exercise]="BG Squat"),
    BLANK()
)

 

This measure will calculate the average based on the selection. You can populate it with all possibilities.

For the target I followed the same logic :

Dynamic Target = 
SWITCH(
    SELECTEDVALUE('Exercises / Target'[Exercises]),
    "Box Squat", 100,
     "BG Squat", 30,
    BLANK()
)

 

AmiraBedh_0-1691326026215.png

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

7 REPLIES 7
AmiraBedh
Resident Rockstar
Resident Rockstar

I am a little bit lost here ? Which visual is having the issue ?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Dear AmiraBedh,
The visual i am strugling with is the KPI Visual.

texnoi_0-1691294195784.png


What i am trying to do is to have a dynamic visual that changes KPI based on chosen variable (in my case table showing different exercises).

texnoi_1-1691294277094.png

 

So when i add a filter (Show me all entries from August 2023) and compare with the target (90) i am not getting the correct visual.

Target is 90. Reached is 70. KPI Visual shows this:

texnoi_2-1691295019745.png

 

Thank you very much for your help!
Warm regards,
Texnoi

 

I can't find any visual with the one you are sharing :

AmiraBedh_0-1691319530094.png


What i am trying to do is to have a dynamic visual that changes KPI based on chosen variable (in my case table showing different exercises)

Can you provide an example of the 2 selections and the KPIs you want to show ?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

It is the small KPI visual. It must show the same as the table on the left.

For example: Target for Box Squat is 100. It should be showed in the KPI visual when the exercise picked from the filter to the right.

I created two measures :

 

Dynamic Average = 
SWITCH(
    SELECTEDVALUE('Data v2'[Exercise]),
    "Box Squat", CALCULATE(AVERAGE('Data v2'[Reps3]),'Data v2'[Exercise]="Box Squat"),
     "BG Squat", CALCULATE(AVERAGE('Data v2'[Reps3]),'Data v2'[Exercise]="BG Squat"),
    BLANK()
)

 

This measure will calculate the average based on the selection. You can populate it with all possibilities.

For the target I followed the same logic :

Dynamic Target = 
SWITCH(
    SELECTEDVALUE('Exercises / Target'[Exercises]),
    "Box Squat", 100,
     "BG Squat", 30,
    BLANK()
)

 

AmiraBedh_0-1691326026215.png

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Thank you it did help! What if i want to combine values from 3 databases:

For example just for the box squat: I want to combine Reps1+reps2+Reps3+Reps4+Reps5 so that i use their data as well. Is it still the Dynamic Range command i need? 

Dynamic Average = 
SWITCH(
    SELECTEDVALUE('Data v2'[Exercise]),
"Box Squat", CALCULATE(AVERAGE('Data v2'[Reps1]),'Data v2'[Exercise]="Box Squat")
    "Box Squat", CALCULATE(AVERAGE('Data v2'[Reps2]),'Data v2'[Exercise]="Box Squat")
      "Box Squat", CALCULATE(AVERAGE('Data v2'[Reps3]),'Data v2'[Exercise]="Box Squat"),
        "Box Squat", CALCULATE(AVERAGE('Data v2'[Reps4]),'Data v2'[Exercise]="Box Squat"),
    BLANK()
)

 

Please provide more details about your model so we can help you 🙂


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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