Forum Discussion
Need help with multi line chart
- Anonymous6 years ago
HI parvathisuku_90,
So you want to create a line chart with a graph of all categories of raw table records except selected items and display two lines of aggregate record line and selected item line for comparison?
If this is a case, I'd like to suggest you create a new table stored value of category 'selected', "others" to use on the line chart as legends.
After these steps, you can use the raw table id field to create a slicer and write measure formulas to interact with slicer to get results based on different line groups.
Measure = VAR currLegend = SELECTEDVALUE ( Category[Legend] ) VAR selected = ALLSELECTED ( RawTable[Key] ) RETURN SWITCH ( currLegend, "Selected", CALCULATE ( AVERAGE ( RawTable[Amount] ), FILTER ( ALLSELECTED ( RawTable ), [Key] IN selected ), VALUES ( RawTable[Date] ) ), "Others", CALCULATE ( AVERAGE ( RawTable[Amount] ), FILTER ( ALLSELECTED ( RawTable ), NOT ( [Key] IN selected ) ), VALUES ( RawTable[Date] ) ) )Regards,
Xiaoxin Sheng
Hello parvathisuku_90 ,
Will you please ellaborate what help you want. Not very clear form the pointers you've mentioned.
These two scenarios are acheived in the above chart
– data from a single grid_element_id highlighted in blue( lets take 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 as exmple)
– data averaged across all grid_element_id is shown in black
But not able to acheive this
- data from all grid_element_id in gray(except 0321e4e3-3b80-4cf5-8b24-4cb583094fe0)
Consider each distinct grid_element_id as one asset, then 3 assets are available in the data . In that one is showing in blue line. Other all(dynamically changes, in this case two) should show in light grey. How can I add those to the exsisting chart( with same line colour).
- amitchandak6 years agoSuper User
parvathisuku_90 , you can average measure that will respond to filter
and a measure like this
new measure =
calculate(Avergae(Table[duration_alarms_7day]), filter(All(Table), not(Table[grid_element_key] in values(Table[grid_element_key]))))new measure =
calculate(Avergae(Table[duration_alarms_7day]), filter(All(Table), not(Table[grid_element_key] in allselected(Table[grid_element_key]))))You can use allselected(Table) in filter in place of all(Table)