Forum Discussion

unnijoy's avatar
unnijoy
Post Prodigy
8 years ago
Solved

Formula Help

MonthCountrySiteProgram NameHC
Jan-18USGreenvilleRunning464
Jan-18USGreenvilleRunning464
Jan-18USGreenvilleRunning464
Jan-18USGreenvilleRunning464
Jan-18USGreenvilleRunning464
Jan-18USGreenvilleRunning464
Jan-18USDalevilleRunning696
Jan-18USDalevilleRunning696
Jan-18USDalevilleRunning696
Feb-18USGreenvilleRunning424
Feb-18USGreenvilleRunning424
Feb-18USGreenvilleRunning424
Feb-18USDalevilleRunning424
Feb-18USDalevilleRunning424
Feb-18USDalevilleRunning424
Feb-18USGreenvilleRunning424

 

Based on the above data i need a formula for ma power bi report in which in the table for for Jan i need the HC for US. As we can see that the program name is repeating. So i need to calcculate the HC in such a way that the formula should calulate the HC once even if the site and program name is repeating. The result should be as follows.

 

MonthcountryHC
Jan-18US1160
Feb-18US824
  • unnijoy

     

    Please try this MEASURE

     

    MeasureF =
    VAR temp =
        CALCULATETABLE ( DISTINCT ( Table1[HC] ), ALL ( Table1[Mode] ) )
    RETURN
        SUMX ( temp, [HC] )

12 Replies

    • unnijoy's avatar
      unnijoy
      Post Prodigy

      Hi Thanks for the Prompt reply. A small change in the Table.

       

      MonthCountrySiteProgram NameModeHC
      Jan-18USGreenvilleRunningOnline464
      Jan-18USGreenvilleRunningILT464
      Jan-18USGreenvilleRunningOnline464
      Jan-18USGreenvilleRunningILT464
      Jan-18USGreenvilleRunningOnline464
      Jan-18USGreenvilleRunningILT464
      Jan-18USDalevilleRunningOnline696
      Jan-18USDalevilleRunningILT696
      Jan-18USDalevilleRunningOnline696
      Feb-18USGreenvilleRunningILT424
      Feb-18USGreenvilleRunningOnline424
      Feb-18USGreenvilleRunningILT424
      Feb-18USDalevilleRunningOnline400
      Feb-18USDalevilleRunningILT400
      Feb-18USDalevilleRunningOnline400
      Feb-18USGreenvilleRunningILT424

       

      In the Table we can see Mode. So the HC should be calculated irrespective of Mode.

      By the formula that u gave the system will calculate the HC seperately for each mode. our Formula should not be based on mode.