Forum Discussion
Sirlearnalot
7 years agoNew Member
Line Chart: Conditional Formatting
Hi, I'm trying to visualise e.g.. sales for a product during a year with campaign periods. Say the product was on campaign in Q1 and Q3 and not Q2 and Q4, I would like to show this in a line chart...
- 7 years ago
Hi Sirlearnalot,
For your scenario, you should create the four measures below to achieve your desired output.
Yes_P1 = CALCULATE(SELECTEDVALUE(Table1[Sales]),FILTER('Table1','Table1'[Campaign period]="Yes"&&'Table1'[Product]=1)) Yes_P2 = CALCULATE(SELECTEDVALUE(Table1[Sales]),FILTER('Table1','Table1'[Campaign period]="Yes"&&'Table1'[Product]=2)) No_P1 = CALCULATE(SELECTEDVALUE(Table1[Sales]),FILTER('Table1','Table1'[Campaign period]="No"&&'Table1'[Product]=1)) No_P2 = CALCULATE(SELECTEDVALUE(Table1[Sales]),FILTER('Table1','Table1'[Campaign period]="No"&&'Table1'[Product]=2))Then you drag these measure to Values Field to create the line chart.
In addition, you could refer to this attachment.
Best Regards,
Cherry
S_Harrison_SD
Advocate I
3 years agoWe have this workaround which is simple to implement
Conditional Format a line chart in Power BI - Select Distinct