Forum Discussion
Need help with multi line chart
| _key | grid_element_key | date | qty_alarms_7day | duration_alarms_7day |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-01 | 45.38917 | 3.814148 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-02 | 78.24933 | 74.81478 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-03 | 5.857458 | 73.57437 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-04 | 2.513788 | 13.53965 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-05 | 92.14781 | 10.05942 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-06 | 55.6088 | 86.40046 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-07 | 30.99461 | 27.20225 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-08 | 23.80493 | 33.04217 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-09 | 97.90973 | 54.01713 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-10 | 52.97118 | 32.85847 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-11 | 4.63898 | 36.54067 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-12 | 62.9751 | 28.00264 |
| f25fc369-2e73-49d1-a6fe-16cb06b4b106 | 0fdd05a9-6977-4dac-8266-ffc42de6f171 | 2010-01-13 | 10.79973 | 41.60459 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-01 | 54.28262 | 65.38411 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-02 | 79.65894 | 33.39506 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-03 | 63.24242 | 3.931321 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-04 | 20.58516 | 23.90161 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-05 | 47.20754 | 36.48876 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-06 | 55.9076 | 90.79858 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-07 | 4.152584 | 24.72576 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-08 | 33.72114 | 78.22688 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-09 | 15.92777 | 78.50816 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-10 | 92.2076 | 5.64891 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-11 | 94.77174 | 22.67628 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-12 | 18.68256 | 90.84214 |
| a7c9be1c-a379-4907-b7b3-bd9b88a8128f | 13b3fe33-537c-4f93-babc-72529b6fafbb | 2019-02-13 | 43.14166 | 3.74307 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-01 | 28.95953 | 75.98046 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-02 | 55.75436 | 52.99937 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-03 | 57.17572 | 4.701374 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-04 | 20.7513 | 14.95151 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-05 | 91.82851 | 39.45962 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-06 | 94.64232 | 92.85916 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-07 | 75.82813 | 35.08725 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-08 | 66.74929 | 21.11391 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-09 | 1.231896 | 49.76245 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-10 | 11.77253 | 46.74265 |
| 893566d0-d49d-40d2-9865-ab164880ee58 | 0321e4e3-3b80-4cf5-8b24-4cb583094fe0 | 2020-03-11 | 41.53835 | 0.992634 |
- data from all grid_element_id in gray(except 0321e4e3-3b80-4cf5-8b24-4cb583094fe0)
– 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
– the points on the x axis come from the "date" column
– the points on the y axis come from the "qty_alarms_7day" column
Can some one please help me
- 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
4 Replies
- bhagyashripatilAdvocate I
Hello parvathisuku_90 ,
Will you please ellaborate what help you want. Not very clear form the pointers you've mentioned.
- parvathisuku_90Helper I
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 blackBut 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).
- amitchandakSuper 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)
- AnonymousNot applicable
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