Forum Discussion

Ahbiswas's avatar
Ahbiswas
New Member
6 years ago
Solved

KPI card visual

I am working with survey response dataset, where a column "Results" indicates if the survey is a pass or a fail using text "Pass" or "Fail".

 

When I use KPI card visual and input the results column into indicator field and Trend Axis field and show the value as "percentage of grand total", it's returning the Pass percentage.

 

Although this is what am looking for but not sure why and how KPI card visual is only showing the pass percentahe and not the fail percentage.

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Ahbiswas 

    I build a sample table.

    I build a calculated column and two measures to have a test.

    Column = CALCULATE(COUNT(User[ID]),ALLEXCEPT(User,User[ID]))/CALCULATE(COUNT(User[ID]),ALLSELECTED(User))
    Measure1 = 
    VAR _sel =
        ALLSELECTED ( 'User'[Statement] )
    RETURN
        CALCULATE (
            COUNT ( User[ID] ),
            FILTER ( ALLSELECTED ( User ), User[Statement] IN _sel )
        )
            / CALCULATE ( COUNT ( User[ID] ), ALL ( User ) )
    Measure 2 = CALCULATE(COUNT(User[ID]),FILTER(User,User[Statement]=MIN(User[Statement])))/CALCULATE(COUNT(User[ID]),ALL(User))

    Result:

    By default,column and measure2 will show Passpercentage without FailPercentage. Measure1is correct.

    Select Fail/Pass, all results are correct.

    Change Values in statement column to have a test.

    We found the KPI with column and Measure2 show 2percentage/ zzzpercentage. Measure1 is correct. The result is related to the measure you use or KPI visual Trend axis will display the entire change, the indicator will display the value of the last point of trend axis(Pass,2,ZZZ) by default. 

    If this relpy still couldn't help you solve your problem, please provide me with your data model and your calculate logic in calculated column. Or you can provide me with your pbix file by your Onedrive for Business.

    You can download the pbix file from this link: KPI card visual

     

    Best Regards,

    Rico Zhou

     

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

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Ahbiswas 

    I build a sample table.

    I build a calculated column and two measures to have a test.

    Column = CALCULATE(COUNT(User[ID]),ALLEXCEPT(User,User[ID]))/CALCULATE(COUNT(User[ID]),ALLSELECTED(User))
    Measure1 = 
    VAR _sel =
        ALLSELECTED ( 'User'[Statement] )
    RETURN
        CALCULATE (
            COUNT ( User[ID] ),
            FILTER ( ALLSELECTED ( User ), User[Statement] IN _sel )
        )
            / CALCULATE ( COUNT ( User[ID] ), ALL ( User ) )
    Measure 2 = CALCULATE(COUNT(User[ID]),FILTER(User,User[Statement]=MIN(User[Statement])))/CALCULATE(COUNT(User[ID]),ALL(User))

    Result:

    By default,column and measure2 will show Passpercentage without FailPercentage. Measure1is correct.

    Select Fail/Pass, all results are correct.

    Change Values in statement column to have a test.

    We found the KPI with column and Measure2 show 2percentage/ zzzpercentage. Measure1 is correct. The result is related to the measure you use or KPI visual Trend axis will display the entire change, the indicator will display the value of the last point of trend axis(Pass,2,ZZZ) by default. 

    If this relpy still couldn't help you solve your problem, please provide me with your data model and your calculate logic in calculated column. Or you can provide me with your pbix file by your Onedrive for Business.

    You can download the pbix file from this link: KPI card visual

     

    Best Regards,

    Rico Zhou

     

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Ahbiswas 

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

     

    Best Regards,

    Rico Zhou

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Ahbiswas 

    Always attach a screenshot for visual queries.

  • Ahbiswas what is your goal? What you want to show? You need to create measures to achieve the result?

    • Ahbiswas's avatar
      Ahbiswas
      New Member

      I have created a measure and have got the result that I was looking for. But my question is more like a query as I can't figure out how KPI card visual is giving me the pass percentage (without a measure)

      • parry2k's avatar
        parry2k
        Super User

        Ahbiswas it is very hard to say without looking at how you the % without measure. Could be that it was taking last value from Pass/Fail. There could be many factors and hard to answer with these little details.

         

        I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

        Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.