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

How can I find the total of each week in a Fiscal Year?

I am trying to find the total per week of fiscal year (Which starts on Oct. 1st) 

 

Here is an example right now: 

mpompilio_0-1679941832354.png

 

I am trying to find the total of each week, based on fiscal year. I want to be able to have this work no matter how many years I have. 

 

Does anyone know how to do this?

 

1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @mpompilio ,

Please try below steps:
1. below is my test table

Table:

vbinbinyumsft_0-1680069184711.png

2. create measure with below dax formula

Fiscal Year =
VAR _date =
    SELECTEDVALUE ( 'Table'[Date] )
VAR _year =
    YEAR ( _date )
VAR _month =
    MONTH ( _date )
VAR _day =
    DAY ( _date )
RETURN
    IF ( _month >= 10 && _day >= 1, _year, _year - 1 ) & "\"
        & IF ( _month >= 10 && _day >= 1, _year + 1, _year )
Week Num =
VAR _date =
    SELECTEDVALUE ( 'Table'[Date] )
VAR _a =
    INT ( LEFT ( [Fiscal Year], 4 ) )
VAR _c =
    DATE ( _a, 10, 1 )
VAR _dif =
    DATEDIFF ( _c, _date, DAY )
RETURN
    QUOTIENT ( _dif, 7 )
Week Total =
VAR _wn = [Week Num]
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Week Num] = _wn )
RETURN
    SUMX ( tmp, [Value] )

3. add a table visual with fields and measures

vbinbinyumsft_1-1680069327448.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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

1 REPLY 1
v-binbinyu-msft
Community Support
Community Support

Hi @mpompilio ,

Please try below steps:
1. below is my test table

Table:

vbinbinyumsft_0-1680069184711.png

2. create measure with below dax formula

Fiscal Year =
VAR _date =
    SELECTEDVALUE ( 'Table'[Date] )
VAR _year =
    YEAR ( _date )
VAR _month =
    MONTH ( _date )
VAR _day =
    DAY ( _date )
RETURN
    IF ( _month >= 10 && _day >= 1, _year, _year - 1 ) & "\"
        & IF ( _month >= 10 && _day >= 1, _year + 1, _year )
Week Num =
VAR _date =
    SELECTEDVALUE ( 'Table'[Date] )
VAR _a =
    INT ( LEFT ( [Fiscal Year], 4 ) )
VAR _c =
    DATE ( _a, 10, 1 )
VAR _dif =
    DATEDIFF ( _c, _date, DAY )
RETURN
    QUOTIENT ( _dif, 7 )
Week Total =
VAR _wn = [Week Num]
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Week Num] = _wn )
RETURN
    SUMX ( tmp, [Value] )

3. add a table visual with fields and measures

vbinbinyumsft_1-1680069327448.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.