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
reinib
New Member

what dax function to highlight parts of a line graph dynamically

I have a power report where I am trying to measure how marketing campaigns has have an impact on the sale of 10 financial instruments (ETF, Fund, etc). 

 

The source of the data is an Excel data sheet which includes the sale for a  product row by row, for each month. There is also a column called MarketingPushed which contains either a 1 or a 0 in the row based on whether or not the product was pushed in marketing that month. 

 

In this dashboard,  I have a graph with different filters and slicers where the main attraction is a graph where is represented a sum of sales for each product for each month from 2021 till now.

 

In order to better visualize the marketing impact on sales, I want this graph to include a shaded region from the date at which a campaign would have started till the end of the campaign. 

 

 

I have included different slicers for the product and this shaded region to only appear when a specific product is selected in the legend. 

 

How do you believe I should proceed? Using a DAX formula? Conditional formatting? 

 

 

thank you for your help,

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @reinib ,

 

To visualize the impact of marketing campaigns on sales in Power BI Desktop, you can use a combination of features such as conditional formatting and data bars.

You can use conditional formatting to highlight the cells that contain the sales data for the products that were pushed in marketing that month. You can also use data bars to create a visual representation of the sales data.

Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

You can add a measure as the field based on to format the style.

 

Best Regards,
Stephen Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @reinib ,

 

To visualize the impact of marketing campaigns on sales in Power BI Desktop, you can use a combination of features such as conditional formatting and data bars.

You can use conditional formatting to highlight the cells that contain the sales data for the products that were pushed in marketing that month. You can also use data bars to create a visual representation of the sales data.

Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

You can add a measure as the field based on to format the style.

 

Best Regards,
Stephen Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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.