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
harrinho
Helper III
Helper III

Measure based on Today's date

Hi Community, 

 

I have the following calculation but I want to add an extra criterion to calculate this only if today's date is > 3. In other words, bring in the results for the following calculation only if today's day is Wednesday and onwards

 

Billable Util_CDL_WEEK = CALCULATE(SUM('cdl weekly'[Hours]),'TIME CATEGORY'[Time Category All]="Billable")/CALCULATE(SUM('cdl weekly'[Hours]),'TIME CATEGORY'[Time Category All]="Available")

I amend it to 

Billable Util_CDL_WEEK = IF(TODAY()<3,"No Util",CALCULATE(SUM('cdl weekly'[Hours]),'TIME CATEGORY'[Time Category All]="Billable")/CALCULATE(SUM('cdl weekly'[Hours]),'TIME CATEGORY'[Time Category All]="Available"))

but it doesn't seem to work. It doesn't return any errors but it doesn't return the correct outcome either

2 ACCEPTED SOLUTIONS
Stachu
Community Champion
Community Champion

you need to use WEEKDAY
https://msdn.microsoft.com/en-us/query-bi/dax/weekday-function-dax

WEEKDAY(TODAY(),2)<3

depending on whether the week starts on Saturday or Sunday you should pass a proper parameter instead of 2



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

Hi @harrinho,

 

Based on the syntax of WEEKDAY function, by default the day ranges from 1 (Sunday) to 7 (Saturday).

 

Syntax : WEEKDAY(<date>, <return_type>)

<return_type>:

 

A number that determines the return value:


Return type: 1, week begins on Sunday (1) and ends on Saturday (7). numbered 1 through 7.

Return type: 2, week begins on Monday (1) and ends on Sunday (7).

Return type: 3, week begins on Monday (0) and ends on Sunday (6).numbered 1 through 7.

 

For your scenario, your return type could be 1.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @harrinho,

 

Have you solved the problem?

 

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you need additional help, please share some data sample and your expected output.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Stachu
Community Champion
Community Champion

you need to use WEEKDAY
https://msdn.microsoft.com/en-us/query-bi/dax/weekday-function-dax

WEEKDAY(TODAY(),2)<3

depending on whether the week starts on Saturday or Sunday you should pass a proper parameter instead of 2



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Thank you @Stachu. The week starts on Sunday, what would be the proper parameter? 

Hi @harrinho,

 

Based on the syntax of WEEKDAY function, by default the day ranges from 1 (Sunday) to 7 (Saturday).

 

Syntax : WEEKDAY(<date>, <return_type>)

<return_type>:

 

A number that determines the return value:


Return type: 1, week begins on Sunday (1) and ends on Saturday (7). numbered 1 through 7.

Return type: 2, week begins on Monday (1) and ends on Sunday (7).

Return type: 3, week begins on Monday (0) and ends on Sunday (6).numbered 1 through 7.

 

For your scenario, your return type could be 1.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.