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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
sarath5140
Helper I
Helper I

Show trend analysis on a line chart

Hi, please help me in solving my below problem.

I have two tables one is incident table and other table is incident postmortem table.
Both the tables are having Id and date time column and these tables are not related. Now, i want to represent them in a line to see the trend for last 6 months till today in a line chart and axis will be my month and values will be the count of ticket ids for both the tables. How can i acheive this, please throw some insights.
3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @sarath5140 ,

 

You can create a calendar table as axis of line chart, then write a measure to lookup and summary records from two tables based on current calendar date and use in value fields. After these, you can enter to analytics panel and turn on trend line features.

 

If you are confused on coding formula, please provide some sample data with expect result to help us clear your requirement and do test and coding formula on it.


Regards,
Xiaoxin Sheng

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

Hi

 

 

 

IncidentIdCreationDateStatus
106053312/28/2019 4:16:58 PMINPROGRESS
105005782/28/2019 3:52:21 PMINPROGRESS
105005581/10/2019 3:52:21 PMINPROGRESS
1069705609/21/2018 3:46:16 PMINPROGRESS
106355162/28/2019 3:30:45 PMINPROGRESS

 

Table B : Postmortem Data

 

IncidentIdSourceCreateDateStatus
81931702019-02-28 16:48:01.0000000RESOLVED
40588432018-02-28 16:48:00.0000000ACTIVE
4058843982019-01-27 16:48:00.0000000RESOLVED
819300312018-02-21 16:48:00.0000000ACTIVE
   

 

Please help me with the Dax formulas and measures and to acheive the trend for both the tables to show the incidentid count vs month trend in line chart.

 

Thanks

HI @sarath5140 ,

 

You can take a look at following sample.

 

Measure formulas:

InProgress =
VAR currDate =
    MAX ( 'Calendar'[Date] )
RETURN
    CALCULATE (
        COUNTROWS ( VALUES ( Incident[IncidentId] ) ),
        FILTER (
            ALLSELECTED ( Incident ),
            [CreationDate]
                >= DATE ( YEAR ( currDate ), MONTH ( currDate ) - 6, DAY ( currDate ) )
                && [CreationDate] <= currDate
                && [Status] = "INPROGRESS"
        )
    )


Resolve = 
VAR currDate =
    MAX ( 'Calendar'[Date] )
RETURN
    CALCULATE (
        COUNTROWS ( VALUES ( Postmortem[IncidentId] ) ),
        FILTER (
            ALLSELECTED ( Postmortem ),
            [SourceCreateDate]
                >= DATE ( YEAR ( currDate ), MONTH ( currDate ) - 6, DAY ( currDate ) )
                && [SourceCreateDate] <= currDate
                && [Status] = "RESOLVED"
        )
    )

Create a line chart with calendar date and two measures, then add a trend line and turn off combine series option.

3.png

 

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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.