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
mohammadyousaf
Helper III
Helper III

Distribution of Data over 24 Hours & Line Chart

Hello.. can someone please help me with the follwoing:

 

I have the following table. I am trying to distribute the output to on 24 hours, my base is Name. The line chart Axis should be 1-24 hours and value distributed accordingly only during the start and end time. 

 

Or is there any better way to show the output / hour. Thank you. 

 

NameStart Date & TimeEnd Date & TimeHoursOut put
M111/09/2021 13:10:0012/09/2021 13:10:002435
M211/092021 07:00.0011/09/2021 09:00:00210
M312/09/2021 11:00:0012/09/2021 15:00:0023
1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @mohammadyousaf,

 

You can't create a chart unless you create an expanded table based on the table you provided.

Try this measure to create a new tabel.

Table 2 =

VAR TIME_ = GENERATESERIES(TIME(0,0,0),TIME(23,59,59),TIME(1,0,0))

RETURN

SUMMARIZE(

    FILTER(

        CROSSJOIN('Table',TIME_),HOUR([Start Date & Time])<=HOUR([Value])&&HOUR([End Date & Time])>HOUR([Value]) || [Hours]=24

    ),

    [Name],[Value],[Out put],[Hours],"output/hour",[Out put]/[Hours]

)

 

Then ,create line chart visual and put the [Value] in Axis and [output/hour] in Values.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-chenwuz-msft
Community Support
Community Support

Hi @mohammadyousaf,

 

You can't create a chart unless you create an expanded table based on the table you provided.

Try this measure to create a new tabel.

Table 2 =

VAR TIME_ = GENERATESERIES(TIME(0,0,0),TIME(23,59,59),TIME(1,0,0))

RETURN

SUMMARIZE(

    FILTER(

        CROSSJOIN('Table',TIME_),HOUR([Start Date & Time])<=HOUR([Value])&&HOUR([End Date & Time])>HOUR([Value]) || [Hours]=24

    ),

    [Name],[Value],[Out put],[Hours],"output/hour",[Out put]/[Hours]

)

 

Then ,create line chart visual and put the [Value] in Axis and [output/hour] in Values.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dear Chenwuz,

 

Thank you and pardon my skills but can you please tell what do you mean [Value] in the above. 

Hi @mohammadyousaf ,

 

The [Value] is the name of column which is created by the DAX expression GENERATESERIES()

Here are the details of GENERATESERIES()

https://docs.microsoft.com/en-us/dax/generateseries-function

And give you my pbix file.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.