cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
IamTDR
Resolver III
Resolver III

Measure for Fiscal Year Totals

Image.png


See above for a Date table I built within my report.  I am trying to do a measure to calculate total units by fiscal year 2022 and 2021.
This measure works but in doing so I would be required to edit the report yearly. 

CY Units = CALCULATE(SUM(SalesSummary[Units]),FILTER('Date','Date'[Fiscal Year]=2022))
 

Any idea how to make this dynamic?  Tried this measure but it returned the total for ALL fiscal years not just 2022.

CY Units = CALCULATE(SUM(SalesSummary[Units]),FILTER('Date',MAX('Date'[Fiscal Year])))

Thanks in advance!

 
1 ACCEPTED SOLUTION
IamTDR
Resolver III
Resolver III

Thanks for replies.
I think I just got this to work on my own. See below for CY and PY measures. I didnt have to create another table either.

CY Units = CALCULATE(SUM(SalesSummary[Units]),FILTER('Date','Date'[Fiscal Year]=MAX('Date'[Fiscal Year])))
PY Units = CALCULATE(SUM(SalesSummary[Units]),FILTER('Date','Date'[Fiscal Year]=MAX('Date'[Fiscal Year])-1))

View solution in original post

4 REPLIES 4
IamTDR
Resolver III
Resolver III

Thanks for replies.
I think I just got this to work on my own. See below for CY and PY measures. I didnt have to create another table either.

CY Units = CALCULATE(SUM(SalesSummary[Units]),FILTER('Date','Date'[Fiscal Year]=MAX('Date'[Fiscal Year])))
PY Units = CALCULATE(SUM(SalesSummary[Units]),FILTER('Date','Date'[Fiscal Year]=MAX('Date'[Fiscal Year])-1))

tackytechtom
Super User
Super User

Hi @IamTDR ,

 

Does it work with this measure?

CY Units = 
VAR _maxYear = MAX ('Date'[Fiscal Year] )
RETURN
CALCULATE ( 
    SUM ( SalesSummary[Units] ),
    FILTER ( 'Date', 
     'Date' [Fiscal Year] = _maxYear
    )
) 

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Yup. Seems this measure works as well. Thanks 

PijushRoy
Solution Sage
Solution Sage

Hi @IamTDR 

 

Please try this
Create New Table = DISTINCT('Calender'[Fiscal Year])
Make relationship witn your calender table Fiscal Year to Fiscal Year
Now do measure
= VAR _FY = SELECTEDVALUE('New Table'[Fiscal Year])
RETURN
CALCULATE(SUM(SalesSummary[Units]),_FY)

 

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors