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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Calculate the amount of available hours

Hi!

I have a table with 5 columns:

Capturar.PNG

I'm having some trouble to calculate the measure Total_Hours. I put this information on a column just to show the results.

Basically this measure is the amount of Available Hours:

Total_Hours = CALCULATE(MAX('Table'[Available]),ALLEXCEPT('Table','Table'[Colab],'Table'[Month]))* CALCULATE(DISTINCTCOUNT('Table'[Colab]),ALLEXCEPT('Table','Table'[Month]))
The problem is that this measure doesn't give the total. When placed on a visual card, it displays only 528 or 480 regardless of the filters.
What I need is a dinamic measure. So if the page doesn't have any selected filter, the result must to be 1.008. If the page has a filter the result needs to make sense with this filter. EXMPLES:
 
1- Any filter: The amount of Available Hours (Total_Hours) is 1008
2 - Filter in Colab (A): The amount of Available Hours (Total_Hours) is 336
3- Filter in Month (Jan): The amount of Available Hours (Total_Hours) is 528
4 - Filter in Colab (A) and Month (Jan): The amount of Availabe Hours (Total_Hours) is 176
 
Can anyone pls suggest me how to solve this?
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a measure like

sumx(summarize('Table', 'Table'[Colab],'Table'[Month],'Table'[Available]),[Available])

 

add filter like , if needed

sumx(summarize(filter('Table' ,'Table'[Colab] = "A"), 'Table'[Colab],'Table'[Month],'Table'[Available]),[Available])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try a measure like

sumx(summarize('Table', 'Table'[Colab],'Table'[Month],'Table'[Available]),[Available])

 

add filter like , if needed

sumx(summarize(filter('Table' ,'Table'[Colab] = "A"), 'Table'[Colab],'Table'[Month],'Table'[Available]),[Available])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Perfect! Thanks very much for your help!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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