Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
tushars22
Frequent Visitor

Creating Trend graphs for Weekly Data

Hi, I am new in Power BI and trying to create a Weekly trand Graph for our IT team .. Sample data is as follows:

 

IDStatusCreation DateLast Modified
44441Fixed5-Feb-206-Feb-20
44442Reopened5-Feb-206-Feb-20
44443New4-Feb-206-Feb-20
44444New5-Feb-207-Feb-20
44445New5-Feb-207-Feb-20
44446Reject4-Feb-207-Feb-20
44447Deferred4-Feb-207-Feb-20
44448Fixed12-Feb-2013-Feb-20
44449Fixed13-Feb-2013-Feb-20
44450Retest13-Feb-2014-Feb-20
44451New12-Feb-2012-Feb-20
44452Reject12-Feb-2013-Feb-20
44453Reject12-Feb-2013-Feb-20
44454Retest14-Feb-2014-Feb-20
44455Deferred14-Feb-2014-Feb-20
44456Fixed14-Feb-2015-Feb-20

 

Need a Graph to show Weekly Trend of Incoming Vs Handled.

 

Weekly Incoming  TrendNew based on Creation Date
Weekly Handled TrendLast Modified date and If Status is "Fixed", "Reject", "Deferred", "Retest"
1 ACCEPTED SOLUTION

Hi @tushars22,

You can check the following steps if they suitable for your requirements.

Steps:

1. Create a expand table based on id and its date ranges.

Expand = 
SELECTCOLUMNS (
    FILTER (
        CROSSJOIN (
            Test,
            CALENDAR ( MIN ( Test[Creation Date] ), MAX ( Test[Last Modified] ) )
        ),
        [Date] >= [Creation Date]
            && [Date] <= [Last Modified]
    ),
    "ID", [ID],
    "Date", [Date]
)

2. Build a relationship from expand table to original table based on id field with 'both' direction mode.

3. Create a line chart with expand table date as axis, original table 'status' as legend and 'id' as value. (If you need a trend line, you can enable it in the analysis panel trend option.)

4. Create a slicer with status fields to choose display records.

Snapshot:

15.png

 

BTW, I also attached the sample file below.

Regards,

Xiaoxin Sheng

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

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @tushars22,

Perhaps you can create a calculated table to extract and expand your date fields and link to the original table. After these, you can directly use them on your visual to analytics records.

Spread revenue across period based on start and end date, slice and dase this using different dates 
Regards,

Xiaoxin Sheng

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

Thank you Xioaxin, BUt i cannot find your solution. The hyperlink you gave takes me to the forum where you provide a solution but on clicking on Go to SOlution, nothing happens.


Can you check and share me the right link please ?

 

Thanks.

Hi @tushars22,

You can check the following steps if they suitable for your requirements.

Steps:

1. Create a expand table based on id and its date ranges.

Expand = 
SELECTCOLUMNS (
    FILTER (
        CROSSJOIN (
            Test,
            CALENDAR ( MIN ( Test[Creation Date] ), MAX ( Test[Last Modified] ) )
        ),
        [Date] >= [Creation Date]
            && [Date] <= [Last Modified]
    ),
    "ID", [ID],
    "Date", [Date]
)

2. Build a relationship from expand table to original table based on id field with 'both' direction mode.

3. Create a line chart with expand table date as axis, original table 'status' as legend and 'id' as value. (If you need a trend line, you can enable it in the analysis panel trend option.)

4. Create a slicer with status fields to choose display records.

Snapshot:

15.png

 

BTW, I also attached the sample file below.

Regards,

Xiaoxin Sheng

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

Thank you @v-shex-msft for below solution. It does help me understand how to create the needed trend.

 

However my requirement has changed as team added more columns int he report  and was hoping you can provide some guidance here

My new Table:

 

 StatusCreation DateLast ModifiedDate FixedDate RejectedDate Deferred
44441Fixed5-Feb-206-Feb-206-Feb-20  
44442Reopened5-Feb-206-Feb-20   
44443New4-Feb-206-Feb-20   
44444New5-Feb-207-Feb-20   
44445New5-Feb-207-Feb-20   
44446Reject4-Feb-207-Feb-20 7-Feb-20 
44447Deferred4-Feb-207-Feb-20  7-Feb-20
44448Fixed12-Feb-2013-Feb-2013-Feb-20  
44449Fixed13-Feb-2013-Feb-2013-Feb-20  
44450Retest13-Feb-2014-Feb-2014-Feb-20  
44451New12-Feb-2012-Feb-20   
44452Reject12-Feb-2013-Feb-20 7-Feb-20 
44453Reject12-Feb-2013-Feb-20 7-Feb-20 
44454Retest14-Feb-2014-Feb-2014-Feb-20  
44455Deferred14-Feb-2014-Feb-20  14-Feb-20
44456Fixed14-Feb-2015-Feb-2015-Feb-20  

 

What I need:

 

Create a Measure or Calculated Column which ever works fine as per below need

Status = Fixed or Rejected or Deferred

Count of all IDs with above status filtered on a day to day basis

 

 

 

amitchandak
Super User
Super User

You can create measures like this

calculate(count(table[ID]))
calculate(count(table[ID]), table[status] in {"Fixed", "Reject", "Deferred", "Retest"})

 

For week like this week , last week and calendar for week wise refer : https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.