cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Gokul Member
Member

measure to custom column (data to be used in legend )

Hi all,,
I need to turn the data in table into a chart and I cannot use the measure on the legend or axis on chart

Avg = var dayNo=INT(AVERAGE('Group Query'[mins])/1440)
var hourNo=INT(MOD((AVERAGE('Group Query'[mins])),1440)/60)
var minuteNO=MOD(MOD((AVERAGE('Group Query'[mins])),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))

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: measure to custom column (data to be used in legend )

Hi @Gokul

Create measures

dayNo = INT(AVERAGE('Group Query'[mins])/1440)

hourNo = INT(MOD((AVERAGE('Group Query'[mins])),1440)/60)

minuteNO = MOD(MOD((AVERAGE('Group Query'[mins])),1440),60)

Then create  a column

column = 
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 mins2 = if([minuteNO]>1,FORMAT([minuteNo],"#0")&" Mins",if([minuteNO]=1,FORMAT([minuteNo],"#0")&" Min",if([minuteNO]=0,""))) Return CONCATENATE(days,CONCATENATE(hrs,mins2))

5.png

 

Best Regards

Maggie

View solution in original post

2 REPLIES 2
Gokul Member
Member

convert measure into custom column

 I need to turn the data in table into a chart and I cannot use the measure on the legend or axis on chart

My Measure:
AvgTurnaroundTime= var dayNo=INT(AVERAGE('Group Query'[_mins])/1440)
var hourNo=INT(MOD((AVERAGE('Group Query'[mins])),1440)/60)
var minuteNO=MOD(MOD((AVERAGE('Group Query'[mins])),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))

Community Support Team
Community Support Team

Re: measure to custom column (data to be used in legend )

Hi @Gokul

Create measures

dayNo = INT(AVERAGE('Group Query'[mins])/1440)

hourNo = INT(MOD((AVERAGE('Group Query'[mins])),1440)/60)

minuteNO = MOD(MOD((AVERAGE('Group Query'[mins])),1440),60)

Then create  a column

column = 
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 mins2 = if([minuteNO]>1,FORMAT([minuteNo],"#0")&" Mins",if([minuteNO]=1,FORMAT([minuteNo],"#0")&" Min",if([minuteNO]=0,""))) Return CONCATENATE(days,CONCATENATE(hrs,mins2))

5.png

 

Best Regards

Maggie

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 294 members 3,049 guests
Please welcome our newest community members: