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
blazer12219
Frequent Visitor

Count of number of days in month

Have field called [Off Contract Date] the value is 04/28/22

 

I need a formula to count number of days elapsed in that particular month so answer should be 28 in the example above but this field is variable and will change, field called [PartialBillingDays]

 

Next would like to create a field called [PartialBilling%]  formulated by dividing (28) or [PartialBillingDays] / the number of days in the month represented in [Off Contract Date] or Date.DaysinMonth([Off Contract Date]) 

 

So in this example the math would be 28 / 30 = .9333%

 

I can get the PartialBilling% to work but just cannot find the correct formula to cover the PartialBillingDays amount.

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use following formula for PartialBillingDays

 

= Date.Day([Off Contract Date])

View solution in original post

4 REPLIES 4
blazer12219
Frequent Visitor

I figured out the error I included a % in name description

blazer12219
Frequent Visitor

I get an error message with that formula

 

if checked to make sure the field was set to a date type {"Off Contract Date", type date}

 

Any thoughts?

Can you click on the error and paste the message here? 

Vijay_A_Verma
Super User
Super User

Use following formula for PartialBillingDays

 

= Date.Day([Off Contract Date])

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.

Top Solution Authors
Top Kudoed Authors