Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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/2022 | JOHN | 35 |
8/27/2022 | JOLYY | 35 |
8/27/2022 | JOHN | 35 |
105 |
This is what I need
Date | Name | Assigned QTY |
8/27/2022 | JOHN | 35 |
8/27/2022 | JOLYY | 35 |
8/27/2022 | JOHN | |
70 |
Solved! Go to Solution.
@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.
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
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
Correct me if I get you wrong. In your original table (e.g., fact_QTY ) duplicate recored are created because a new record is generated each time a user goes out or moves. To remove duplicate records, you can create a summary table as below.
fact_QTY_summarize=summarize(fact_QTY, fact_QTY[Date], fact_QTY[NameAssigned QTY])
Thank you for your help.
Correct , each time user goes out or move system creates a new record with new code with fixed QTY.
best way is count the duplicates, based on dates and devide the fixed Qty on Count.
Thank you
@Jeanxyz it's not a good idea to start creating tables to support individuial visualizations. Create a nice, clean star/snowflake design and write measures appropriately.
I'm also thinking there needs to be some thought about repeating ABC twice in the same day in a visualization.
Hi @Zaibsrule88. Define a measure for Total QTY = SUM(AssignedQTY). On a matrix visual, drop date and name in rows and the measure Total QTY for values.
There's no need to alter the underlying table for this. Hope this helps!
@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.
First of all Thank you for your response and really appriciate it,
I will try to explain the issue in more detail/
I have to assign a fixed target to each member " lets say forty"
sometimes name appears twice in a date and the problem is I dont have to remove it , I want build a way that if name appears twice in a day I assign a fixed value to that particular name only once,
lets say
abc 40
xyz 40
abc "Repeated" "Should be 0 " because its repeated twice in same day
@Zaibsrule88 I don't believe you should have to alter data to achieve this. It sounds like the kind of thing that could be handled in a visual or in how a measure is defined. Can you provide some sample data to play with?
I want sum to be 55 and 65 if code and date is same