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

Join 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.

Reply
JFAschoon
Helper I
Helper I

Converting a measure to column

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

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.

 

PhilipTreacy
Super User
Super User

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.