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
Anonymous
Not applicable

Group SUM by single Date

Hi everyone,

I'm new to Power BI and Dax and currently I have some Problems with one of my Measures.

 

I need to count the Days where an Employee booked more than 10 hours workingtime.

The raw Data looks like that. One Employee can book multiple timebits per day.

 

Bildschirmfoto 2020-09-07 um 13.49.53.png

Bildschirmfoto 2020-09-07 um 13.50.04.png

I tried follwing DAX Expression:

GT10H = CALCULATE(COUNTROWS(DimDate),FILTER(fact_timebits,SUM(fact_timebits[hours])>10))

 

Of cause the Result is 3, because the total Sum of hours for the three Days is greater than 10. Is there a possibility to only take the daily workingtime into consideration, so i get 1 as result ?

 

Thanks for your help!!

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Can you try this measure:

GT10H = 
COUNTROWS(
FILTER(
SUMMARIZE(
    fact_timebits,
    fact_timebits[Date],
    "Total", CALCULATE(SUM(fact_timebits[hours]))
),
"Total">10)
)



________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try measures like

 

Hours =SUM(fact_timebits[hours])
GT10H = CALCULATE(COUNTROWS(DimDate),values(DimDate[date]),FILTER(fact_timebits,[Hours] >10))
sumx(filter(Values(DimDate[date]), [Hours] >10),COUNTROWS(DimDate))

Fowmy
Super User
Super User

@Anonymous 

Can you try this measure:

GT10H = 
COUNTROWS(
FILTER(
SUMMARIZE(
    fact_timebits,
    fact_timebits[Date],
    "Total", CALCULATE(SUM(fact_timebits[hours]))
),
"Total">10)
)



________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.