Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a table with two columns - "SKU" and "Parentorchild".
If a SKU is a "Parent" (highlighted in yellow), I want to hide all instances where the SKU is also a "child" (highlighted in red).
I do not want to hide any instances where the SKU is only a child but not a parent. Only when the SKU is both a child and parent, should the child rows be hidden. Is there a calculated column or measure that can help with this?
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26RhwF59nThEKCkWRn0?e=3NTtfA
This solution partially works. There are cases when a duplicate SKU is child. Then both duplicate rows where Parentorchild = Child are removed. Can you modify this code to account for this duplication?
Is this what you are looking for?
show an example so that I can understand and help you
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
It is for creating a new column.
I hope the below can provide some ideas on how to create a solution for your datamodel.
Expected result CC =
VAR _conditionP =
COUNTROWS (
FILTER ( Data, Data[SKU] = EARLIER ( Data[SKU] ) && Data[Parentorchild] = "P" )
)
VAR _conditionC =
COUNTROWS (
FILTER ( Data, Data[SKU] = EARLIER ( Data[SKU] ) && Data[Parentorchild] = "C" )
)
RETURN
IF (
_conditionP = 1
&& _conditionC = 1,
IF ( Data[Parentorchild] = "P", Data[Parentorchild], BLANK () ),
Data[Parentorchild]
)
User | Count |
---|---|
77 | |
76 | |
41 | |
29 | |
24 |
User | Count |
---|---|
96 | |
91 | |
52 | |
47 | |
46 |