Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Calculated Measure on Chart

Hello,

 

I have a measur like bellow. But i didn't use this measure on chart. How can i solve this problem?

 

koray_0-1644564630321.png

 

 

Measure = VAR TotalSeconds =
    SUMX (
        'Mesai_Talep_Formu',
        HOUR ( 'Mesai_Talep_Formu'[Süre_Mesai] ) * 3600
            + MINUTE ( 'Mesai_Talep_Formu'[Süre_Mesai] ) * 60
    )
VAR Days =
    TRUNC ( TotalSeconds / 3600 / 24 )
VAR Hors =
    TRUNC ( ( TotalSeconds - Days * 3600 * 24 ) / 3600 )
VAR Mins =
    TRUNC ( MOD ( TotalSeconds, 3600 ) / 60 )
RETURN
    IF ( DAYS = 0, "", IF ( DAYS > 1, DAYS & "days ", Days & "day" ) )
        & IF ( Hors < 10, "0" & Hors, Hors ) & ":"
        & IF ( Mins < 10, "0" & Mins, Mins )

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Power BI doesn't support to put Time or Text data in Values field on bar chart / column chart. And Power BI doesn't have Duration type in reports. You can remain the TotalSeconds and return it as result in the measure. Or you can also convert TotalSeconds to Minutes / Hours and return the result. Below is an example for TotalMinutes. 

Measure1 =
VAR TotalSeconds =
    SUMX (
        'Mesai_Talep_Formu',
        HOUR ( 'Mesai_Talep_Formu'[Süre_Mesai] ) * 3600
            + MINUTE ( 'Mesai_Talep_Formu'[Süre_Mesai] ) * 60
    )
VAR TotalMinutes =
    DIVIDE ( TotalSeconds, 60 )
RETURN
    TotalMinutes

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

7 REPLIES 7
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Power BI doesn't support to put Time or Text data in Values field on bar chart / column chart. And Power BI doesn't have Duration type in reports. You can remain the TotalSeconds and return it as result in the measure. Or you can also convert TotalSeconds to Minutes / Hours and return the result. Below is an example for TotalMinutes. 

Measure1 =
VAR TotalSeconds =
    SUMX (
        'Mesai_Talep_Formu',
        HOUR ( 'Mesai_Talep_Formu'[Süre_Mesai] ) * 3600
            + MINUTE ( 'Mesai_Talep_Formu'[Süre_Mesai] ) * 60
    )
VAR TotalMinutes =
    DIVIDE ( TotalSeconds, 60 )
RETURN
    TotalMinutes

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

VijayP
Super User
Super User

@Anonymous 

I have checked your File , Since the measure producing Pure Text , and Value will not allow the Text Measure you will not be able to use this on any chart with filter context




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

Thank you @VijayP 

 

Isn't there a solution to this? 

VijayP
Super User
Super User

@Anonymous 

if you can share pbix i can help , but Have you changed that to duration and check whether it is working?




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

@VijayP 

 

I sent the pbix file with a private message. Thank you.

VijayP
Super User
Super User

@Anonymous 

The Formula Result is a Text as you are using Concatination. 

It will not be allowed on any chart except in Table. 

In any other chart it should be numeric Value!




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

Thank you @VijayP 

 

So how can we change this measure to numeric? reference topic is here. 
https://community.powerbi.com/t5/Desktop/About-Time-Calculation/m-p/2325715

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.