Forum Discussion

Zaibsrule88's avatar
Zaibsrule88
Frequent Visitor
4 years ago
Solved

what if date is same

I'm new on PBI, working on a report where Ive to show QTY for a user for specific day - Problem is if user go out twice or more Ive to show only assign QTY.   Date Name Assigned QTY  8/27/2...
  • Jeanxyz's avatar
    Jeanxyz
    4 years ago

    littlemojopuppy , have you created a messure called AssignedQTY and remove duplicates in that measure? If you simply sum up AssignedQTY, that won't remove the duplicates. To remove the duplicate, you need to

     

    1. in the fact table, create a new column to calculate the number of times a name appearing on a specific day. If a name appear twice on the same day, column duplicate count will generate 2.

    2. create a measure to make sure if a name appear more than once on the same day, the total QTY should be divided by duplicate count. Below is the table showing the correct QTY.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Zaibsrule88 

     

    Please new a measure.

     

    Total =
    VAR _table =
        SUMMARIZE ( 'Table', 'Table'[Code], 'Table'[Date], 'Table'[AvailableCap] )
    VAR _total =
        SUMX ( _table, 'Table'[AvailableCap] )
    RETURN
        _total

     

    The PBIX file is attached for reference.

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data