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

How to calculate amount by dividing the count of selected month in the slicer back to fiscal month

Hi,

 

Please Find the screen shot below :

 

Capture1.PNG

Here i have selected Aug in the slicer , which is 5th month from April, so my new field which i want to generate would be calculated as :

 Total Amount for eg in east region is 1868 and month selected in slicer is Aug so count from slicer which i want is 5 ( April to Aug).

I will divide this amount by the count ( 1868/5) which is my required calculated field.

Also this  count which i want from slicer will change as per month ( i.e. if i select Oct the count would be April to oct i.e 7

How do i acheive this

 

Thanks,

Gp

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@gauri ,

add this column in your calendar
Start Year = Startofyear([Date],"3/31")

 

create a measure 

meausre =
divide(Sum(Table[Amount]), datediff(Max(Date[Start Year]),max(Date[Date]),month))

 

Creating Financial Calendar - From Any Month
https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calend...

View solution in original post

@gauri , if it is less by one for all records. You can add +1

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@gauri ,

add this column in your calendar
Start Year = Startofyear([Date],"3/31")

 

create a measure 

meausre =
divide(Sum(Table[Amount]), datediff(Max(Date[Start Year]),max(Date[Date]),month))

 

Creating Financial Calendar - From Any Month
https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calend...

@amitchandak This is giving me datediff as 3 if i select july month as per datediff function, whereas it should be 4

@gauri , if it is less by one for all records. You can add +1

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.