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
JD0963
Helper I
Helper I

Previous 3 weeks tickets created?

Hello everyone, I hope someone can help me with this. Please see the attached chart. The axis is the weenum of the year (using a calendar table, linked with creationdate) and the values are counts of tickets created in the week number.

 

I want this to somehow say value of tickets created for the current week, plus previous 2 weeks. So the axis would have the current week (1) and the previous 2 weeks (52 and 51)

 

Is this at all possible? Also, would it be easy to have the week name instead? For example, my weeks are Monday to Sunday, would it be possible to have the axis to display the date of the monday instead of the week number?

 

Ideally it would look like the second chart? (sorry for the bad drawing)

 

Thank you for any help!!

 

current                                                                                            ideal

 Chart.jpgChart2.jpg

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated field formula

 

=CALCULATE(COUNTA(Data[Ticket Number]),DATESBETWEEN(Calendar[Date],MIN(Calendar[Date])-14.MAX(Calendar[Date])))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Smauro
Solution Sage
Solution Sage

Hey there @JD0963

You have mentioned a calendar table. Is this table in Power Query?
If so, you could easily add a new column in the Power Query which will compute the Date each week started. Say that your day column is named [Day], then adding this using the Advanced Editor:

#"Inserted WeekStart" = Table.AddColumn(|YOURPREVIOUSSTEP|, "WeekStart", each Date.StartOfWeek([Day], Day.Monday), type date)
in
#"Inserted WeekStart"

will add a column with the date you're seeking. Alternatevely, you can add the column by selecting the [Day] and going Add column - > Date -> Week -> Start of Week. But the start of week will be Sunday. You'll then have to go on the step, click the gear and add the ", Day.Monday" after [Day].

On how it will be displayed on graphs, you can change it in Power BI Data view, selecting [WeekStart] and going Modeling -> Format etc.


Now, if you only want to display always the last three weeks, I believe you can simply do a visual filter on the chart you'll use WeekStart: Relative, is in the last [3] calendar weeks.


Hope that helps! 🙂




Feel free to connect with me:
LinkedIn

Hi, thanks for your reply! My powerbi dashboard uses a tabular cube I have bult in SSAS - this is where the calendar table comes from! Is there any way of building what you described into my cube?

 

Sorry, I am quite new to this

 

Thank you

Hi @JD0963,

 

>> My powerbi dashboard uses a tabular cube I have bult in SSAS - this is where the calendar table comes from!

When you use live mode, current only as tabular mode support to add custom measure, other edit operations will be disabled in live mode.(in as cube mode, all edit feature will be disabled)

 

You can't enter to 'query editor' and add calculated tables in live mode.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.