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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Lsh0576
Frequent Visitor

DAX Query Help Please!

Hello there! 

 

I would like to ask for help with writing a query in DAX. Here is what I am trying to do..

 

I will be reporting this Resource Capacity' equation on a weekly basis:

 

Number of Administrators (17) X Average Work Completed (12) = 204 multiply by fraction of weeks remaining in the year (XX / 52)

 

Can someone please help me write this? I got to the 204 part but not sure how to write the fraction of weeks remaining in the year.

 

Thank you so much, I appreciate the help!

 

Belle

1 ACCEPTED SOLUTION

Hi,

Write this masure to calculated Remaining weeks in year

Remaining weeks in year = calculate(min(Calendar[Weeks until end of year]),datesbetween(calendar[date],date(year(today()),12,31),date(year(today()),12,31)))-calculate(min(Calendar[Weeks until end of year]),datesbetween(calendar[date],today(),today()))+1

Use this measure in the denominator.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Lsh0576
Frequent Visitor

I also created a date field in my master table ('Date_Today') so I can link the Master table to the Calendar table by DATE field. 

 

Lsh0576_0-1688059424010.png

 

Ashish_Mathur
Super User
Super User

Hi,

Ensure that you have a Calendar Table with a week number column in your PBI file.  Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello there! So I got the calendar table built with a column of 'weeks remaining in the year':

Lsh0576_0-1688048102145.png

Now I need to know how to incorporate this to build the metric:

 

Lsh0576_1-1688048201897.png

Instead of dividing by 2, I need to multiply by fraction of weeks remaining in the year.

Hi,

Write this masure to calculated Remaining weeks in year

Remaining weeks in year = calculate(min(Calendar[Weeks until end of year]),datesbetween(calendar[date],date(year(today()),12,31),date(year(today()),12,31)))-calculate(min(Calendar[Weeks until end of year]),datesbetween(calendar[date],today(),today()))+1

Use this measure in the denominator.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors