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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Alex_0201
Post Partisan
Post Partisan

Convert measure into a column

Hi 🙂 Is it possible to convet this measure into a column? 

 

Total depth = ((
var _stepno = SELECTEDVALUE('DM_WELL_PLAN_OP'[step_no])
return
IF(
_stepno=0,
SELECTEDVALUE('DM_WELL_PLAN_OP'[md_to]),
LOOKUPVALUE('DM_WELL_PLAN_OP'[md_to],'DM_WELL_PLAN_OP'[step_no],_stepno+0)
))+SUM(CD_DATUM[datum_elevation]))*(-1)*0.3048
8 REPLIES 8
v-eqin-msft
Community Support
Community Support

Hi @Alex_0201 ,

 

I could not know the result you want based on a single measure. Please upload some data samples and expected output.

Last but not least! Please do mask sensitive data before uploading.Thanks.

 

Best regards,

Eyelyn Qin

amitchandak
Super User
Super User

@Alex_0201 , As you are using a slicer value. It will not respond to the changes in the slicer. Only the first value will be taken while creating the column. I think not possible.

hi @amitchandak thank you for the comment! Possible to find a workaround? 

 

@Alex_0201 , leave it like measure use "values", or summarize to put a context. 

 

example

 

sumx(Values(Table[User]),distinctCOUNT(Table[category]))
sumx(summarize(Table,Table[User],"_1",distinctCOUNT(Table[category])),[_1])

 

 

example - https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...

https://www.youtube.com/watch?v=My0bLn9voo4

az38
Community Champion
Community Champion

Hi @Alex_0201 

try smth like

Total depth = 
var _stepno = 'DM_WELL_PLAN_OP'[step_no]
var _tmp = 
IF(
_stepno=0,
'DM_WELL_PLAN_OP'[md_to],
LOOKUPVALUE('DM_WELL_PLAN_OP'[md_to],'DM_WELL_PLAN_OP'[step_no],_stepno+0)
)

return

_tmp 
+
SUM(CD_DATUM[datum_elevation]))*(-1)*0.3048

 

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi @az38 thanks! but get this error message:

A table of multiple values was supplied where a single value was expected.

az38
Community Champion
Community Champion

@Alex_0201 

I think it's because one (or all) of mentioned fields in statement is a measure that should be rewrtitten also


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38 checked, they all are regular columns.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.