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.
I am trying to find the total per week of fiscal year (Which starts on Oct. 1st)
Here is an example right now:
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?
Solved! Go to Solution.
Hi @mpompilio ,
Please try below steps:
1. below is my test table
Table:
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
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.
Hi @mpompilio ,
Please try below steps:
1. below is my test table
Table:
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
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
97 | |
75 | |
71 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |