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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors