Forum Discussion

Victormar's avatar
Victormar
Helper V
3 years ago

Line chart with different patterns

Hello community,

 

I reach out to you all because I am trying to create a line chart having the same line with different patterns.

We have some data that we generated, and some that we get from machines, resulting in a mileage line altogether; The idea would be to simulate 1 line, where the generated data would be a dotted line and the non generated a normal line.

We have a columnt to identify wether the data is generated or not using 1 (generated) or 0.

 

I created a couple of measures, but due to filtering the lines don't overlay ( I did it using variables because first I tried without and it didn't work either, so just trying something different):

 

c_EnergyConsumptionGenerated =
var generated = FACT_Readings[EGC_IS_GENERATED] = 1
var result = IF (
generated, FACT_Readings[c_EnergyConsumption]
)
return result
 
c_EnergyConsumptionNOTGenerated =
var not_generated = FACT_Readings[EGC_IS_GENERATED] = 0
var result = IF (
not_generated, FACT_Readings[c_EnergyConsumption]
)
return result
 
c_EnergyConsumption is the main column where we calculate the Energy, then we calculate the average of it as a measure and add it to the graph. In my mind I could create these two measures to highlight the different points, but as Power BI would joint all the data points in a line chart, the result would look odd, and not overlaid:
 

Red is generated, and black is not.

 

Thanks in advance for any help, have a nice day!

2 Replies

  • Hi Hei_aQing , the expected output would be 1 line in which some parts are dotted and others are straight, depending on the data.

    My idea was to overlay the two lines to do it, but as my filter is a column "IS_FILTERED" that means it excludes some of the data points, resulting in different lines.

    Didn't share any sample data because I guess it doesn't matter, sample data would serve to try it out.

     

    Thanks for your time 🙂