Forum Discussion

anacpint's avatar
anacpint
Helper I
4 years ago
Solved

Problem with total value

Hello, I have the following measure: OTD_TESTE = IF([COUNTReport]=2, CALCULATE(DIVIDE(SUM(FactOTDJnJPap[measurevalue]),2)), SUM(FactOTDJnJPap[measurevalue]))   COUNTReport = CALCULATE(DISTINCT...
  • anacpint's avatar
    anacpint
    3 years ago

    Thank you for your answer.

     

    This was the solution for the problem:

    OTD_TESTE =
    SUMX (
    SUMMARIZE ( FactOTDJnJPap, DimSite[jnj_site], DimTypeReport[type_of_report] ),
    CALCULATE (
    IF (
    [COUNTReport] = 2,
    DIVIDE ( SUM ( FactOTDJnJPap[measurevalue] ), 2 ),
    SUM ( FactOTDJnJPap[measurevalue] )
    ),
    FactOTDJnJPap[IDTypeReportJnJPharma] IN { 1, 5 }
    )
    )

     

    Best Regards, Ana.