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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Arnoux
Frequent Visitor

Month Completion formula only if filtered month is equal to current month

Hi Everyone.

 

So I have a problem and think I have a solution, but not sure if it is possible

 

I have a measure built in to show me how far the current month is completed and shows me a perc

 

MonthCompletion = CALCULATE( DAY(TODAY()-1)/30)

 

I use this in the targets for each month to keep it Linearised against the Actuals

 

My problem now is that when I filter for prev months the Target KPI is multiplaying by a perc of the current month completion

 

Linearised Booking Target = dim_budget[Target Bookings]*[MonthCompletion]

 

So my question is,.. Is there a way where I can write an If statement in to change the month completion formula to show 1 or 100% when filtered month is not equal to Month(Now())

 

Thanks in Advance

Arnoux

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

Hi @Arnoux,

Could you please post sample data of your scenario. If you have Date column in your table, you can use the following formula to create MonthCompletion measure.

MonthCompletion = IF(MONTH(MAX('Date'[Date]))=Month(NOW()), CALCULATE(DAY('Date'[Today]-1)/30), 1)


And please check the following screenshots about what MonthCompletion is set in different months.
1.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
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

2 REPLIES 2
v-yuezhe-msft
Employee
Employee

Hi @Arnoux,

Could you please post sample data of your scenario. If you have Date column in your table, you can use the following formula to create MonthCompletion measure.

MonthCompletion = IF(MONTH(MAX('Date'[Date]))=Month(NOW()), CALCULATE(DAY('Date'[Today]-1)/30), 1)


And please check the following screenshots about what MonthCompletion is set in different months.
1.PNG

Thanks,
Lydia Zhang

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

Hi Lydia. Than you so much.

 

What you have in that picture is exactly what i need !

 

How did you get that right.

 

Regards 

Arnoux

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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