Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Incorrect Total in table and KPI Card

Hi Everybody,

 

I have a problem with showing the correct number reported by my report according to one column.

 

Sorry for hiding data label, but we are working in a production environment.

 

As you can see, the sum of the last column, given by [first measure] - ([avg(percentage)]*[Third measure]) should be -35, but it reports - 65 as the consequence of 355 - (743*0,565).

 

Is there any method to reach -35 instead of -65?

 

Thanks,

D

  • Hi, Anonymous 

     

    You can try the following methods.
    [Value1] and [Value2] are measures.

    Measure1 = [Value1]-AVERAGEX('Table B',[Percent])*[Value2]
    Measure2 = 
    Var _table=SUMMARIZE('Table A','Table A'[Type],'Table A'[Month],"Result",[Measure1])
    Var _total=SUMX(_table,[Result])
    Return
    IF(HASONEVALUE('Table A'[Month]),[Measure1],_total)

    Is this the result you expect? Please see the attached document.

     

    Best Regards,

    Community Support Team _Charlotte

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

3 Replies

  • Hi Damiax,

    You can use this measure :

    Measure =
    SUM ( Feuil1[Val1] )
        - ( SUMX ( 'Feuil1', 'Feuil1'[Percentage] * 'Feuil1'[Val2] ) )
     
    Hope it helps.
    Did I answer your question? Mark my post as a solution!
     
    Regards

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi dadb25 , I've tried your solution but I got a tottaly wrong number.

      My Feuil1[Val1] is a distinct count measure coming from a column of table A, percentage is a column of Table B and Feuil1[Val2] is another distinct count measure coming from a column of table C.

      I don't know whether this could be a problem

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Anonymous 

     

    You can try the following methods.
    [Value1] and [Value2] are measures.

    Measure1 = [Value1]-AVERAGEX('Table B',[Percent])*[Value2]
    Measure2 = 
    Var _table=SUMMARIZE('Table A','Table A'[Type],'Table A'[Month],"Result",[Measure1])
    Var _total=SUMX(_table,[Result])
    Return
    IF(HASONEVALUE('Table A'[Month]),[Measure1],_total)

    Is this the result you expect? Please see the attached document.

     

    Best Regards,

    Community Support Team _Charlotte

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