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
Gokul
Helper IV
Helper IV

convert measure to calculated column

how can i convert measure to calculated column ??? i want to use it in a matrix value field ..

this is my measure:

AvgTurnaroundTimeForPendingTask = var dayNo=INT(AVERAGE('Task Query'[task_pending_datediff_minutes])/1440)
var hourNo=INT(MOD((AVERAGE('Task Query'[task_pending_datediff_minutes])),1440)/60)
var minuteNO=MOD(MOD((AVERAGE('Task Query'[task_pending_datediff_minutes])),1440),60)
var days=if(dayNo>1,dayNO&" Days ",if(dayNo=1,dayNO&" Day "))
var hrs=if(hourNo,FORMAT(hourNo,"#0")&" Hrs ",if(hourNo=1,FORMAT(hourNo,"#0")&" Hr "))
var mins=if(minuteNO>1,FORMAT(minuteNo,"#0")&" Mins",if(minuteNO=1,FORMAT(minuteNo,"#0")&" Min",if(minuteNO=0,"")))

return CONCATENATE(days,CONCATENATE(hrs,mins))

6 REPLIES 6
Anonymous
Not applicable

I know this is very old thread but is there a way through which we can convert measure created by selectedvalue function to calculated column.

Please let me know if this can be done, it will be a great help for me.

Anonymous
Not applicable

Hi @Gokul,

 

Could you please give any sample data or pbix file?

 

 

Regards,

Ravi

you can have a look over this ...this is my scenario!!!!

https://community.powerbi.com/t5/Desktop/sort-the-date/m-p/555672#M261755

Anonymous
Not applicable

TurnAroundTime =
VAR DayNo =
INT ( DIVIDE ( INT ( 'Task Query'[task_pending_datediff_minutes] ), 1440 ) )
VAR HourNo =
INT (
DIVIDE (
INT ( MOD ( INT ( 'Task Query'[task_pending_datediff_minutes] ), 1440 ) ),
60
)
)
VAR Minuteno =
MOD (
INT ( MOD ( INT ( 'Task Query'[task_pending_datediff_minutes] ), 1440 ) ),
60
)
VAR days =
IF ( dayNo > 1, dayNO & " Days ", IF ( dayNo = 1, dayNO & " Day " ) )
VAR hrs =
IF (
hourNo,
FORMAT ( hourNo, "#0" ) & " Hrs ",
IF ( hourNo = 1, FORMAT ( hourNo, "#0" ) & " Hr " )
)
VAR mins =
IF (
minuteNO > 1,
FORMAT ( minuteNo, "#0" ) & " Mins",
IF ( minuteNO = 1, FORMAT ( minuteNo, "#0" ) & " Min", IF ( minuteNO = 0, "" ) )
)
RETURN
CONCATENATE ( days, CONCATENATE ( hrs, mins ) )

 

 

 

Try this one this will work for column

hi @Anonymous how can we use this calculated column in matrix table  value filed

Anonymous
Not applicable

Hi @Gokul,

 

I am giving a sample pbix file. Have look and reveret me if any concern.

Link: https://drive.google.com/file/d/1X1Ot1B3ekUyk8SbAXM9xS4eyk6esNtxG/view?usp=sharing

 

With Reagrds,

Ravi

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.