cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Last 12 Periods when Period is Data type "Text" and not "DateTime"

Hi all,

 

Kindly assist with this problem.

 

My Line chart has an axis with Period & FiscalYear i.e.  P1 2019/20, P2 2019/20 and P3 2019/20. The data type is Text instead of DateTime

Last 13 Period.PNG

 
 

I am trying to apply fitler to show the last 12 Period from selection. That is, if I select P12 2019/20, I want to plot values from P1 2019/20 to P12 2019/20.

 

Kindly assist.

 

Thanks,

 

Phresh

 

 

4 REPLIES 4
Highlighted
Super User IV
Super User IV

Re: Last 12 Periods when Period is Data type "Text" and not "DateTime"

@PhreshMan Based on your input, you are saying you don't have any date column that can help to get the last 12 months? Is this correct? 






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Highlighted
Frequent Visitor

Re: Last 12 Periods when Period is Data type "Text" and not "DateTime"

Hi Parry2k,

 

I have two tables in my data model:

 

Sales                                                         Date

Sales Date  (Date)                                      Date:  i.e. 1/2/2019, 2/5/2019, 26/8/2019 (Date)  

Branch   (Text)                                           Period: P1 to P12 (Whole Number)

....                                                               PeriodYear:  i.e. PI 2019/20, P2 2019/20 (Text)

etc

 

PeriodYear is used in the Axis.

 

Regards,

 

Highlighted
Microsoft
Microsoft

Re: Last 12 Periods when Period is Data type "Text" and not "DateTime"

@PhreshMan 

You could check this article to understand the logic of getting last n month.

Not sure about your model, the sample file is here with PeriodYear Text column as the slicer.

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Frequent Visitor

Re: Last 12 Periods when Period is Data type "Text" and not "DateTime"

Hi Paul,

Please excuse the delay in getting back to you.

Below is an additional issue I am trying to resolve.

I am trying to write  the following DAX: 

 

12 Fiscal Period Rolling = SUM of last 12 Periods, include the current Period. (I am not using Week, Month, Quarter)

 

TABLE: DATE                 TABLE: SALES      
FiscalPeriod                    Sales                             12 Fiscal Period Rolling
FP1                                   20
FP2                                   60
FP3                                  30
FP4                                  40
FP5                                  10
FP6                                  20
FP7                                 40
FP8                                 20
FP9                                 20
FP10                               50                                  310
FP11                              70                                   360
FP12                              30                                   330

 

Kindly assist.

Regards,

 

PhreshMan

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors