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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
powerbilover123
Regular Visitor

Hours

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @powerbilover123 ,

I created some data:

vyangliumsft_2-1713410554244.png

 

Here are the steps you can follow:

1. Create calculated table – slicer table.

Table 2 =
CALENDAR(
    DATE(2021,1,1),
    DATE(2021,2,1))

vyangliumsft_3-1713410554245.png

2. Create measure.

Measure =
var _select=SELECTEDVALUE('Table 2'[Date])
return
SUMX(
    FILTER(ALL('Table'),
    'Table'[Date]=_select&&'Table'[ID]=MAX('Table'[ID])),DATEDIFF([Start_Date],[End_Date],HOUR))

3. Result:

vyangliumsft_4-1713410581529.png

 

If it doesn't meet your expected results, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

 

Best Regards,

Liu Yang

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

1 REPLY 1
Anonymous
Not applicable

Hi  @powerbilover123 ,

I created some data:

vyangliumsft_2-1713410554244.png

 

Here are the steps you can follow:

1. Create calculated table – slicer table.

Table 2 =
CALENDAR(
    DATE(2021,1,1),
    DATE(2021,2,1))

vyangliumsft_3-1713410554245.png

2. Create measure.

Measure =
var _select=SELECTEDVALUE('Table 2'[Date])
return
SUMX(
    FILTER(ALL('Table'),
    'Table'[Date]=_select&&'Table'[ID]=MAX('Table'[ID])),DATEDIFF([Start_Date],[End_Date],HOUR))

3. Result:

vyangliumsft_4-1713410581529.png

 

If it doesn't meet your expected results, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.