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
Shelley
Continued Contributor
Continued Contributor

Why is Power BI Seeing Last Fiscal Year data as current fiscal year?

We've had this happen before and I don't know why. We're trying to calculate YTD Sales, using these formulas. (Our fiscal year ends on 9/30). 

 

Total Revenue Converted =
SUM('Sales'[Total_Revenue_Converted])

 

Current FYTD Sales =
TOTALYTD('Sales'[Total Revenue Converted], 'Daily_Calendar'[Date], "09/30")

 

 

We have customers that have 0 sales for a product line this current fiscal year, but have sales for this same product in the last fiscal year. Power BI is showing the sales for LAST year as the CURRENT YTD sales. Why??? I don't get it.

2 REPLIES 2
Shelley
Continued Contributor
Continued Contributor

I should clarify. The formulas below work for TOTALS. They do not work for details. For example, if one drills down from customer to product to look at the details, Power BI sees product sales from the PREVIOUS year as the current year when the customer hasn't actually purchased this product in the current year. This is so incredibly frustrating. I have tried every YTD formula I can think of and found on the Internet. There's a gotcha with every one - total correct/detail not, details correct/totals not. I don't know why this is so difficult with Power BI. This was super easy with QlikView. 

 

I got it to work using flags on the calendar, but then changing any time filters blanks these out.

 

Flag: YTD =

   IF('Daily_Calendar'[Fiscal_Month] <=

       LOOKUPVALUE('Daily_Calendar'[Fiscal_Month], Daily_Calendar[Date], MAX(Sales[Posting_date])),

           1,0)

 

Flag: Prior Fiscal Year =

   IF('Daily_Calendar'[Fiscal_Year] = [Prior Fiscal Year],

           1,0)

 

Flag: Current Fiscal Year =

   IF('Daily_Calendar'[Fiscal_Year] =

       LOOKUPVALUE('Daily_Calendar'[Fiscal_Year], Daily_Calendar[Date], MAX(Sales[Posting_date])),

           1,0)

 

Prior FYTD Revenue $USD = CALCULATE (
    SUM ( Sales[Total_Revenue_Converted] ),
    FILTER (
        ALL ( 'RA_Daily_Calendar' ),
        'RA_Daily_Calendar'[Flag: Prior Fiscal Year] = 1
            && [Flag: YTD] = 1 
                      ))

 

Current FYTD Revenue $USD =
CALCULATE (
    SUM ( Sales[Total_Revenue_Converted] ),
    FILTER (
        ALL ( 'Daily_Calendar' ),
        'Daily_Calendar'[Flag: Current Fiscal Year] = 1
            && [Flag: YTD] = 1
                  ))

 

 

v-yulgu-msft
Employee
Employee

Hi @Shelley,

 

To calculate YTD for current fiscal year and last fiscal year, please have a look at below similar thread:

DAX of YTD and LYTD based on Fiscal year 1st Sept to 31st Aug

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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.

Top Solution Authors