Reply
insandur
Helper II
Helper II
Partially syndicated - Outbound

How to get, Selected and Previous 4 YearQtr values in chart upon filtering specific YearQtr

Hi,

 

I have a table with year qtr coulmn combined and using Year qtr as X axis and sales in Y axis.  When a select any specifc Yeartqr for eg 2024 Q1, i should get only selected YearQtr and Previous four Qtr values. like 2024 Q1, 2023 Q4, 2023Q 3, 2023 Q2.

 

i got it for month, but not getting it for Qtr.        Thank you in advance.

 

insandur_1-1710754600339.png

 



insandur_0-1710754534712.png

 

1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Syndicated - Outbound

Hi @insandur 

I have already done this logic.

Please do the below steps:

Create separate date table having distinct value of Transaction Date. Don’t create any relationship with Transaction date table. It should be disconnected table.

Step 1. Date Table= DISTINCT[Transaction date]

 

Step2: Measure 12 Month sales=
var Current= MAX( Date[Transtion date])
var PreviousMonth= DATE(Year(Current), Month(Current)-12, Day(Current))

var Result= CALCULATE( SUM(Transction[sales]),
                                                                 Filter(ALL(Transction date),
                                    Transction[transctiondate]>=PreviousMonth &&  Transction[transctiondate]<= Current))

      

               Return Result.

By selecting single date graph shows last 12 month date .but graph has trasction date on x axis and on slicer we have taken new Date table date. No connection between them.

Uzi2019_0-1710755918977.png

 

and if this is not clear you can refer below video.

https://www.youtube.com/watch?v=duMSovyosXE

 

I hope I answered your question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

3 REPLIES 3
v-yohua-msft
Community Support
Community Support

Syndicated - Outbound

Hi, @insandur 

Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

 

Uzi2019
Super User
Super User

Syndicated - Outbound

Hi @insandur 

I have already done this logic.

Please do the below steps:

Create separate date table having distinct value of Transaction Date. Don’t create any relationship with Transaction date table. It should be disconnected table.

Step 1. Date Table= DISTINCT[Transaction date]

 

Step2: Measure 12 Month sales=
var Current= MAX( Date[Transtion date])
var PreviousMonth= DATE(Year(Current), Month(Current)-12, Day(Current))

var Result= CALCULATE( SUM(Transction[sales]),
                                                                 Filter(ALL(Transction date),
                                    Transction[transctiondate]>=PreviousMonth &&  Transction[transctiondate]<= Current))

      

               Return Result.

By selecting single date graph shows last 12 month date .but graph has trasction date on x axis and on slicer we have taken new Date table date. No connection between them.

Uzi2019_0-1710755918977.png

 

and if this is not clear you can refer below video.

https://www.youtube.com/watch?v=duMSovyosXE

 

I hope I answered your question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Syndicated - Outbound

Hi @insandur 
If my solution realy helped you please accept it as a solution so other may find it helpful.

 

Thank you for your support.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)