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
PhreshMan
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
V-pazhen-msft
Community Support
Community Support

@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.

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

parry2k
Super User
Super User

@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? 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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.

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,

 

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.