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

Need to show Last 5 CYs, 5 FYs, all quarters & months of selected date's year and all dates

Hi All,

 

I need to show result like below based on selected date in Ascending order.

CY- previous five calendar years from selected date

FY - previous Five finacial years from selected date

Q - all quarters of selected date's Year

Months - all months of selected date's year

Dates - All previous dates of selected date's month

(suppose if i select 04-Jan-2022 in filter it has to show 04- - jan -2022,03- jan - 2022,02 - jan - 2022,01-jan-2022 dates in ascending order)

Above all should show in same report there are so many categories to show in columns so could not create report by increasing canvas size.

 

It will be great help for me if i get solution, please check below for sample data.

 

 

Price Date (ddmmyyyy)Price typeCalculated fieldprice ($)
01-01-2017CYCY-20173000
01-01-2018CYCY-20182500
01-01-2019CYCY-20193200
01-01-2020CYCY-20204000
01-01-2021CYCY-20212700
01-01-2022CYCY-20226000
01-01-2023CYCY-20235500
01-04-2017FYFY-20173500
01-04-2018FYFY-20182700
01-04-2019FYFY-20193800
01-04-2020FYFY-20203900
01-04-2021FYFY-20213100
01-04-2022FYFY-20225500
01-01-2021QQ1-20211500
01-04-2021QQ2-20211200
01-07-2021QQ3-20211700
01-10-2021QQ4-20212100
01-01-2022QQ1-20221900
01-04-2022QQ2-20221800
01-07-2022QQ3-20221500
01-10-2022QQ4-20221600
01-01-2022MJan - 2022400
01-02-2022MFeb - 2022350
01-03-2022MMar - 2022600
01-04-2022MApr - 2022360
01-05-2022MMay - 2022400
01-06-2022MJun - 2022390
01-07-2022MJuly - 2022260
01-08-2022MAug -2022300
01-09-2022MSep - 2022400
01-10-2022MOct -2022410
01-11-2022MNov - 2022500
01-12-2022MDec - 2022250
01-01-2022D01-01-2022100
01-02-2022D01-02-202290
01-03-2022D01-03-202280
01-04-2022D01-04-2022110
01-05-2022D01-05-2022120
01-06-2022D01-06-202270
01-07-2022D01-07-202260
01-08-2022D01-08-202270
01-09-2022D01-09-202260
01-10-2022D01-10-2022150
01-11-2022D01-11-2022110
01-12-2022D01-12-2022120
01-13-2023D01-13-2023140
01-14-2023D01-14-2023130
01-15-2023D01-15-2023170
01-16-2023D01-16-2023100
01-17-2023D01-17-202385
01-18-2023D01-18-202387
01-19-2023D01-19-202392
01-20-2023D01-20-202395
01-21-2023D01-21-202380
01-22-2023D01-22-202370
01-23-2023D01-23-202360
01-24-2023D01-24-2023

75

 

Suppose, if i select the date 04-01-2022 (ddmmyyyy) rows should be appear like below in ascending order.

 

Result should be as below,

ResultComments
PeriodPrice 
Cy-20182500 
Cy-20193200 
Cy-20204000 
Cy-20212700 
Cy-20226000Calendar year of selected date and Previous four calendar years
Fy-20173500 
Fy-20182700 
Fy-20193800 
fy-20203900 
Fy-20213100Financial year of selected date and Previous four financial years
Q1-20221900All quarters in selected date's year if i select other dates
Jan-22400All Months in selected date's year if i select other dates
01-01-2022100 
02-01-202290 
03-01-202280All previous dates in selected date's month

Regards,

Kusa

3 REPLIES 3
Kusaadigarla01
Frequent Visitor

@FreemanZ@amitchandak, @Sahir_Maharaj, @tamerj1, @Greg_Deckler, @lbendlin, @olgad, @jaweher899, @Ahmedx

 

Dear all, We are looking for solution since so many days, Finally have put the query in power bi community. Need your help achieve my needful. Please go through the query and please help. Please message me asap if you can not understand the requirement.

 

@Kusaadigarla01 , You have to create a dimension or extended dimension and need many to many join filter directions from new dim to fact/old date dim.

 

In this new dimension, dates will repeat for CY, FY and Month etc

Date , Type

2020-12-31 , FY 2020

2020-12-31 , CY 2020

2020-12-31 , Dec-2020

 

Based on what you need

 

Then use this dimension

 

I do not have a date example handy, but you can refer to these

https://medium.com/microsoft-power-bi/power-bi-formatted-p-l-with-custom-sub-totals-and-blank-rows-e...

https://amitchandak.medium.com/power-bi-show-unselected-values-as-others-7d4857b3ceab

https://amitchandak.medium.com/power-bi-add-grand-total-row-in-the-bar-visual-44c3d1d463be

FreemanZ
Super User
Super User

hi @Kusaadigarla01 

not sure about your expectation. 

you wanna show the date ranges or you want to present something further for the mentioned date ranges? What is that?

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.