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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.