The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I got a table that looks like this:
My goal is to add a new column called NEWDIST where the DIST value is used unless there are rows with same ID. In that case it should use the DIST value of the of the ID with a blank REF. For the table here the result should look like:
I added the COUNT column to with find the duplicates in ID and tried to do an IF statement in a calculated column:
Solved! Go to Solution.
Hi,
I am not sure if the whole possible situations are considered, but seeing the sample provided above, I tried to create a calcualted column like below.
Please check the attached pbix file and the below picture.
New DIST CC =
IF (
Data[Ref] = BLANK (),
Data[DIST],
MAXX (
FILTER ( Data, Data[ID] = EARLIER ( Data[ID] ) && Data[Ref] = BLANK () ),
Data[DIST]
)
)
Hi,
I am not sure if the whole possible situations are considered, but seeing the sample provided above, I tried to create a calcualted column like below.
Please check the attached pbix file and the below picture.
New DIST CC =
IF (
Data[Ref] = BLANK (),
Data[DIST],
MAXX (
FILTER ( Data, Data[ID] = EARLIER ( Data[ID] ) && Data[Ref] = BLANK () ),
Data[DIST]
)
)
Thanks a lot Jihwan_Kim! It solved my problem 🙂
User | Count |
---|---|
78 | |
77 | |
36 | |
32 | |
29 |
User | Count |
---|---|
91 | |
79 | |
57 | |
48 | |
48 |