Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
slow_turtle03
Frequent Visitor

Date Filtering - Fiscal Year

I have the dates aligned to follow the fiscal year, but the data is still showing from last year. July starts our fiscal year, I want the data to populate as we go through the months. So in the photo below everything should be blank except July, until August begins etc.

 

slow_turtle03_0-1658923390299.png

 

1 ACCEPTED SOLUTION

Okay, so you would just need some slight modifications for the year.  Try this please..

 

FYYearNum =

VAR FYStartMonth = 7
VAR CurrentYear = Year ( TB_MDH_DATA_DAILY_MONTHLY[DT] )
VAR CurrentMonth = Month ( TB_MDH_DATA_DAILY_MONTHLY[DT] )
VAR PriorYear = CurrentYear - 1

RETURN
IF ( CurrentMonth >= FYStartMonth, PriorYear, CurrentYear )

 

View solution in original post

8 REPLIES 8
slow_turtle03
Frequent Visitor

No, it looks like this. 

 

slow_turtle03_0-1658925619266.png

 

Do you have a column in your date table for Fiscal Year?  For example, July 2022 - June 2023 would be 2022.  Then use the fiscal year as the filter.

I don't know how to write this. Do you have an example?

This is what I have for Month:

 

FYMonthNum =

VAR FYStartMonth = 7

//Update the fiscal year starting month above *Use number between 1 to 12

RETURN

IF (

MONTH ( TB_MDH_DATA_DAILY_MONTHLY[DT] ) >= FYStartMonth,

MONTH ( TB_MDH_DATA_DAILY_MONTHLY[DT] )

- ( FYStartMonth - 1 ),

12

+ (

MONTH (TB_MDH_DATA_DAILY_MONTHLY[DT] )

- ( FYStartMonth - 1 )

)

)

Okay, so you would just need some slight modifications for the year.  Try this please..

 

FYYearNum =

VAR FYStartMonth = 7
VAR CurrentYear = Year ( TB_MDH_DATA_DAILY_MONTHLY[DT] )
VAR CurrentMonth = Month ( TB_MDH_DATA_DAILY_MONTHLY[DT] )
VAR PriorYear = CurrentYear - 1

RETURN
IF ( CurrentMonth >= FYStartMonth, PriorYear, CurrentYear )

 

jennratten
Super User
Super User

Hello - I believe this is becuase there is not a filter on the year.  You can modify the dates included in your visual either by using the filters pane, selecting the relevant date range, or you can create measures for time periods such as current year, prior year, etc.

If I filter by year and select 2022, it shows Jan - July. I would like it to start on July. Do I need to filter the column some how?

In the visual pane, for month, click the drop-down menu and choose show items with no data.  Does that work?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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
Top Kudoed Authors