1

I have a numerical column in Power BI and I display the average of it in a KPI card. It updates every day with data refresh. Is there any way to display the aggregated decimal number in days and hours like 3.5 should be 3 days and 12 hrs.

I also have a calculated measure which also gives me the same result in decimal, and I want that also to be displayed in days, and hours.

ZygD
  • 22,092
  • 39
  • 79
  • 102
Shivam Sarin
  • 551
  • 1
  • 7
  • 20

1 Answers1

1

This is one way how you could approach it.

Sample table "tbl1":
enter image description here

AVERAGE(tbl1[col1]) evaluates to 3.33...
AVERAGE(tbl1[col2]) evaluates to 3.5

Measure for col1:

avg_col1 = 
VAR _mean = AVERAGE(tbl1[col1])
RETURN INT(_mean) & " days " & FORMAT(_mean,"hh") & " hours"

Measure for col2:

avg_col2 = 
VAR _mean = AVERAGE(tbl1[col2])
RETURN INT(_mean) & " days " & FORMAT(_mean,"hh") & " hours"

Resulting cards:
card type visualizations

ZygD
  • 22,092
  • 39
  • 79
  • 102