Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Good day
I have the following measure. how do i convert it to a column syntex.
Show=
var a = filter(allselected('CM18'),'CM18'[Event]="PumpOFF")
return if(SELECTEDVALUE('CM18'[Index.0]) in UNION(SELECTCOLUMNS(a,"Index",[Index.0]),SELECTCOLUMNS(a,"Index",[Index.0]-1),SELECTCOLUMNS(a,"Index",[Index.0]+1)),1,0)
Thanks in advance for any assistance
Hi, @JFAschoon
You can try the following methods.
Column1 = SELECTCOLUMNS(FILTER(ALLSELECTED('CM18'), 'CM18'[Event] = "PumpOFF"), "Index", [Index.0])Column2 = SELECTCOLUMNS(FILTER(ALLSELECTED('CM18'), 'CM18'[Event] = "PumpOFF"), "Index", [Index.0] - 1)Column3 = SELECTCOLUMNS(FILTER(ALLSELECTED('CM18'), 'CM18'[Event] = "PumpOFF"), "Index", [Index.0] + 1)Column4 = IF(SELECTEDVALUE('CM18'[Index.0]) IN UNION(Column1, Column2, Column3), 1, 0)
It can be tested to see if it fits your situation. If it fails to resolve, please provide example data.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @JFAschoon
Can you provide sample data, and explain what the column is suposed to contain?
Hard to work this out just be looking at some code.
Phil
Proud to be a Super User!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 78 | |
| 40 | |
| 31 | |
| 27 | |
| 27 |