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

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!

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 works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


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.