cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alex_0201
Post Partisan
Post Partisan

Measures into Columns

Hi everyone! I have two mesures Total Depth and Total Time. Since I can't plot them in one line chart ( Depth vs Time where Time is on the X-axis), I need to convert these measures into columns. How do I do it?
 
Capture.PNG
Total depth = ((
var _stepno = SELECTEDVALUE('DM_WELL_PLAN_OP'[step_no])
return
IF(
_stepno=1,
SELECTEDVALUE('DM_WELL_PLAN_OP'[md_from]),
LOOKUPVALUE('DM_WELL_PLAN_OP'[md_to],'DM_WELL_PLAN_OP'[step_no],_stepno-1)
))+SUM(CD_DATUM[datum_elevation]))*(-1)*0.3048
 
Total time = (CALCULATE(SUM('DM_WELL_PLAN_OP'[target_duration]),FILTER(ALL('DM_WELL_PLAN_OP'),'DM_WELL_PLAN_OP'[step_no]<MAX('DM_WELL_PLAN_OP'[step_no])))+0)/24
6 REPLIES 6
v-kelly-msft
Community Support
Community Support

Hi @Alex_0201 ,

 

Once converted to columns,you will get fixed values,which wont be changed by your parameter.

Try below expressions:

Total depth = (( 
var _stepno = 'DM_WELL_PLAN_OP'[step_no]
return
IF(
_stepno=1,
'DM_WELL_PLAN_OP'[md_from],
LOOKUPVALUE('DM_WELL_PLAN_OP'[md_to],'DM_WELL_PLAN_OP'[step_no],_stepno-1)
))+CD_DATUM[datum_elevation]*(-1)*0.3048
 
Total time = (CALCULATE(SUM('DM_WELL_PLAN_OP'[target_duration]),FILTER('DM_WELL_PLAN_OP','DM_WELL_PLAN_OP'[step_no]<EARLIER('DM_WELL_PLAN_OP'[step_no])))+0)/24
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

 

Hi @v-kelly-msft many thanks! I've used the expression for creating a new column called Total time, but its values are higher than in the measure by constant 0.04. Any idea where is this difference coming from?

Hi @Alex_0201 ,

 

Could you pls provide  me some raw data in editable format to test?

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

Hi @v-kelly-msft would this table do?

 

Capture.PNG

Hi @Alex_0201

 

Not exactly,this format will be a time cost,if possible,could you pls upload your .pbix file to onedrive business and share the link with us?

Much appreciated.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
mwegener
Super User II
Super User II

Hi @Alex_0201 ,
I would say that is not possible.
Columns are static and measures are dynamic.
If the dynamic is to be preserved, this is not possible.

Otherwise you can create a corresponding calculated table if necessary.

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #
"Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website


Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.