Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

If same column has multiple values in another column

Hello,

I have Act ID number and Repair type. Same Act ID number can have multiple Repair types (total of 9 repair types exists).

Usually it has same repair types (its a train maintenance and Act ID depends on quantity of wagons).

But there are few exceptions where same Act ID, have different repairs, in example below Act ID 7139, had one ER-1 repair and two TP-3 repairs, and I want this Act not to be visible in my time calculations and main report.

Indre_0-1612852436886.png

Thank you for your help!

 

1 ACCEPTED SOLUTION

@Anonymous , You can create a new column that can act as flag to filter

if(calculate(distinctcount(Table[repair type]), filter(table, [Act ID] =earlier([Act id])))=1, true(), false())

 

or a measure like

sumx(filter(summarize(Table, Table[Act ID], "_1", distinctcount(Table[repair type]), "_2", count(Table[Act ID])), [_1] =1),[_2])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , what is the expected output, can you please provide the same.

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandakunfortunatelly I dont think I can share pbix.

I want to make report where would be visible how much hours were used on specific repair type (column chart), actual hours worked vs norms (line), where norms are fixed hours depending on repair type.

Indre_0-1612854365995.png

But I want to remove values, where same Act ID has different repair types, because these are exceptions and distorts results.

 

E.g. TP-3 fixed rate is 9 hours, where ER-1 fixed rate is 18 hours, as its train we cant set TP-3 finished earlier as one wagon cant be released separatly, and there are also other staturary reasons.

 

@Anonymous , You can create a new column that can act as flag to filter

if(calculate(distinctcount(Table[repair type]), filter(table, [Act ID] =earlier([Act id])))=1, true(), false())

 

or a measure like

sumx(filter(summarize(Table, Table[Act ID], "_1", distinctcount(Table[repair type]), "_2", count(Table[Act ID])), [_1] =1),[_2])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Perfect, it worked! Thank you! 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors