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
h_l
Post Patron
Post Patron

Adding Trend Line, Track the Result by Group

Hello everyone,

 

To track and compare what actions attribute the most sigificant change on data, I'm going to add more trend lines in visual.

Sample PBI file is here.

 

In dashboard, an overall trend line visual has been created, to summarzie the total impressions and show by date:

h_l_2-1622643856423.png

What we want, is to add more trend lines to sum impressions specific Campaign ID in specific Action Week or Type. (See following raw table)

E.g. A new line for WK6, another for WK10, etc...

In line "WK6", Sum Impressions where Page (in Raw Table) contains value in Campaign ID in WK6, which are news029164 and news012808

 

There are 2 tables:

- Progress Table: manually filled by business teams. The "Campaign Page ID" is contained in "Page" column in Raw Table.

Please be noted, one Campaign ID can appears multi times.

h_l_1-1622643796941.png

 

- Raw table: exported from DB.

h_l_0-1622643784199.png

 

It's acceptable by creating Measure one by one, e.g. create "Campaigns in WK6" for a line, create another Measure "Campaign in WK10" for another line.

Reason:

- there are over 20 Million rows in the real-data. Adding one more column might lead to a heavy load and performance issue.

- the action is not taken every weeks, so I think I can accept to create Measure by using DAX one by one, if the performance is better than adding one more column in Raw Table.

 

 

Any idea? Sample PBI file is here.

Thanks & have a safe day.

H

 

 

1 ACCEPTED SOLUTION

Hi  @h_l ,

 

Create a measure as below:

Measure 2 = SUMX(VALUES('Progress Record'[Campaign Page ID]),'Progress Record'[Measure])

And you will see:

v-kelly-msft_0-1623207444806.png

For the related ,pbix file,pls see attached.

 

Best Regards,
Kelly

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

View solution in original post

10 REPLIES 10
h_l
Post Patron
Post Patron

Hi @v-kelly-msft 

 

While it's working perfectly on Table Tisual, the breadown by ActionType or ActionWeek data cannot be added into trendline:

 

图片.png

 

But once I tried to breakdown by either ActionType, or ActionWeek, I cannot add "Total Impressions" anymore.

h_l_0-1623209065441.png

 

Since the purpose is to give a insight on: What Type of Action (or action taken in which week) triggers the biggest improvment, the Idea line visual is to display Total Impressions and Each ActionType (or ActionWeek) Sum Impressions in same Visual for comparison.

 

Please let me know if there is a workaround.

Thanks again for the great help from you.

H

 

Hi  @h_l ,

 

You could create a date table as X axis:

 

Date = UNION(VALUES('Progress Record'[Action Date]),VALUES('Raw'[Date]))

 

Then create a relationship as below:

 
v-kelly-msft_0-1623232546180.png

Then you can put ActionType, or ActionWeek in the visual.But for your sample data,there's no relationship between dates in 2 tables,so you would see nothing when you put the field into the visual.

Check my updated .pbix file attached.

 

Best Regards,
Kelly

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

Hi @v-kelly-msft ,

 

I tried to create relation between 2 tables on Dates, but still nothing.

h_l_0-1623251316669.png

 

h_l_1-1623251390095.png

 

Seems I didn't get the point, sorry for my baby level understanding in PBI.

 

But anyway, the 1st reply from you resolve the problem, I will create 2 visuals as workaround.

Visual 1 (left) add trend lines: for Total Impression, and Total Measure 2 (Final Calculation) to see the total change on progress.

Visual 2 & 3: add trend lines: for Total Measure 2 breakdown by "Week" or "Type" as Legend, to see how each Type or Week contribute to Total Changed Progress.

h_l_2-1623251791112.png

 

 

h_l
Post Patron
Post Patron

I tried to create Measure like following

Measure = 
VAR inPR =
SELECTEDVALUE('Progress Record'[PageID])
Return
calculate(sum(Raw[Impressions]),
        FILTER ( Raw
        , SEARCH (inPR, Raw[URL], 1, -1 ) > 0 ))

h_l_0-1622770783305.png

 

But seems there is something wrong if check on by "Week" Total.

h_l_1-1622770839627.png

 

Appreciated if there is any help on this.

 

 

Hi  @h_l ,

 

Create a measure as below:

Measure 2 = SUMX(VALUES('Progress Record'[Campaign Page ID]),'Progress Record'[Measure])

And you will see:

v-kelly-msft_0-1623207444806.png

For the related ,pbix file,pls see attached.

 

Best Regards,
Kelly

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

@v-kelly-msft 

Appreciate it!

This solution can make it either sum by Action Type, or Action Week, able to breakdown by date with hierarchy. Superb!

 

parry2k
Super User
Super User

@h_l it will be easier if you share a sample pbix file, remove sensitive information before sharing.



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'm not sure why the uploaded file was deleted.

I just updated the link, please try.

Here is the sample file.

 

Thanks for reply.

H

parry2k
Super User
Super User

@h_l you can use action week or action type on the legend and it will give you a line for each week or type. You can use only one column on the legend.

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



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 think i need to search the Campaign ID from Page to get sum of impressions first, since they are "contained".

So that I cannot directly build active relations.

On the other hand, it's multi-to-multi since Campaign ID repeats in Progress Table.

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.