Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Aggregated Value in KPI

Hello!

 

I would like to develop some KPI visuals that shows both the breakdown each month, and the entire calculation as a number (like a card). I'd like to essentially combine a card visual with a line visual. I already know how to use the KPI Indicator visual, but unfortuantely the only aggregation types available (in the card part) are: Last Value, Average, and Sum. What happens if I want to show (CALCULATE(COUNT(Value), Value>=200))/(CALCULATE(COUNT(Value)) broken down by month on a line chart and not broken up by month (aggregated by my calculation) as the value all in one visual? I hope this makes sense and isn't convoluted, but I can explain further if this doesn't make sense or needs some clarification.

 

Thank you!

 

MonthValue
Dec-20150
Dec-20160
Dec-20200
Jan-2110
Jan-21180
Jan-21200
Jan-21500
Feb-21150
Feb-21200
  • Anonymous , Try Like

     


    measure =
    divide(COUNTX(filter(Values(Table[month]), Table[Value]>=200),CALCULATE(sum(Table[Value]))),CALCULATE(COUNT(Value)))

2 Replies

  • Anonymous , Try Like

     


    measure =
    divide(COUNTX(filter(Values(Table[month]), Table[Value]>=200),CALCULATE(sum(Table[Value]))),CALCULATE(COUNT(Value)))

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

    Here are the steps you can follow:

    1. Create calculated column.

    Month1 = MONTH('Table'[Month])

    2. Create measure.

    Measure =
    var _200=CALCULATE(COUNT('Table'[Value]),FILTER(ALL('Table'),'Table'[Month1]=MAX('Table'[Month1])&&'Table'[Value]>=200))
    var _all=CALCULATE(COUNT('Table'[Value]),FILTER(ALL('Table'),'Table'[Month1]=MAX('Table'[Month1])))
    return
    DIVIDE(_200,_all)

    3. Result:

    You can downloaded PBIX file from here.

     

    Best Regards,

    Liu Yang

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