Forum Discussion

Deimantas's avatar
Deimantas
Frequent Visitor
3 years ago

Incorrect total value in table

Hi Guys, 


I know there are multiple threads opened for this issue, but I can't apply any of them to my issue.(I'm new with Power BI/ Dax ) 
So I have a problem the total in my table is wrong I read that Power  Bi applies filters as default and you can rebuild the total value with sumx but I can't make that work for me. 

Column count of pickinghours2  it's a distinctive count of pickinghours2
For test11: 

 

Test11 = VAR lopas =
DISTINCTCOUNT(pickingproductivityview[pickinghour2])
Return
IF(AND(lopas>= 3 , lopas <= 6 ), lopas - 0.5,IF(lopas>6, lopas - 1,IF(lopas < 3,lopas,BLANK())))



 

2 Replies

  • The suggestion would be to return blank there, with the code below:

    Test11 = 

    VAR lopas =

            DISTINCTCOUNT(pickingproductivityview[pickinghour2])

        Return

        IF (

                HASONEVALUE (pickingproductivityview[user],

            IF(

                AND(lopas>= 3 , lopas <= 6 ), 

                lopas - 0.5,

                IF(

                    lopas>6, 

                    lopas - 1,

                    IF(lopas < 3,lopas,BLANK())

                 )

            ),

    BLANK()

    )

    • Deimantas's avatar
      Deimantas
      Frequent Visitor

      Hi FreemanZ,

      Thank you for the replay. 

      Unfortunately, now I don't see any values in the total section and if I'm trying to use this measure in "Card" visual is not displaying anything. 

      I have used your suggestion as per below: 

      Test11 =
      VAR lopas =
      DISTINCTCOUNT(pickingproductivityview[pickinghour2])

      Return
      IF(HASONEVALUE(pickingproductivityview[codprp]),
      IF(AND(lopas>= 3 , lopas <= 6 ), lopas - 0.5,IF(lopas>6, lopas - 1,IF(lopas < 3,lopas,BLANK()))),BLANK())