Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Overall Sum for each row

Hi All,

 

I would like to know how to calculate this in a table.

 

ActionNumber of HitsVisit Count
What is Range3170254209
What is Verified2499057736
What can be informed1444958315
Collapse1226411129
Sign literature 692961015
which partner627068906
Expand368833737
Vary Information242376180
Tile Click28049
Blank 29416
Total102717458692

 

 

The user would like to see the total of Column C ( Visit Count) in every record like the one shown below 

 

Expected Result:

 

ActionNumber of HitsVisit Count
What is Range31702458692
What is Verified24990458692
What can be informed14449458692
Collapse12264458692
Sign literature 6929458692
which partner6270458692
Expand3688458692
Vary Information2423458692
Tile Click2458692
Blank 458692

 

 

Vist count is a Column with a if statement in it. 

 

Vist Count = 
if (overall_rank = 1 then visit_count else 0)

 

help me achieve this.

 

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    I have replicated the scenario and it is giving me result as expected. 

     

13 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I think you need to use "all" in  your DAX  try this 

     

    if (overall_rank = 1 then All(visit_count) else 0)

     

     

    Thanks,

    Aditya

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous  ,

       

      Thanks for the help ,

       

      but its throwing me an error saying below 

       

      " A table of Multiple Values was supplied  where a single vlaue was expected"

       

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      Can you try this :

       

      if (overall_rank = 1 then sumx(All(Enter visitcount table name herer),visit_count) else 0)

       

       if this doesn't work, please let me know with some sample data.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Anonymous  nope it gave a weired numbers.. i it didn't worked.

  • Anonymous's avatar
    Anonymous
    Not applicable
    Total= sumx(All(Table1),Table1[Visit Count])
    • Anonymous's avatar
      Anonymous
      Not applicable

      Anonymous 

       

      I tried this before you sent it to me, its throwing some weired numbers as well.

      • Anonymous's avatar
        Anonymous
        Not applicable

        It is not inside if statement.