Forum Discussion
Creating a multiple line chart report based on selections from disconnected slicers
Hi!
I have a report that I need to complete. I have succeeded to create a multiple line chart based on selections from two disconnected slicers, but the data in the line charts are wrong.
First some explaination of my case. Below you see a table with sampledata on fish. here you see a small part, but the line charts should show Avgweight on x axis and value on y axis from Table2. There can be a line chart per group and I can choose line charts from the disconnected slicer(s) which consist of a distinct list of group elements. I don't want to bother you explaining why the data seems a bit duplicated, but what I need is to pick one value, for instance for avgweight 959 for group K-factor you see three rows. I need to pick one of values, perhaps the one with min(index) which is 2821. Later I can add more slicers like cage, location, sampledate and so on, but the measure must work without using these. I hope you understand. A last thing I need to add to the measures a logic so they return blank if no elements in the Measurement1 slicer are selected. Just now all lines are shown if I have not selected any items. Below you see two of the measures I have started on. the first should calculate min values from the K-factor in the group column, and the next should calculate min values from the Pigment in the group column. I need to correct thes measures so I work as described above. the calculate part is of course wrong and must be replaced.
| AvgWeight | Location | Cage | SampleDate | Group | Value | Index |
| 902 | Danielsvika | 02 | 26.02.2019 15:00:00 | Pigment | 3,96 | 2981 |
| 902 | Danielsvika | 02 | 26.02.2019 15:00:00 | K-Faktor | 1,2368 | 2971 |
| 959 | Store Kufjord | M2 | 10.03.2019 15:00:00 | K-Faktor | 1,0208 | 2836 |
| 959 | Store Kufjord | M2 | 10.03.2019 15:00:00 | Pigment | 5,89 | 2846 |
| 959 | Store Kufjord | M3 | 10.03.2019 15:00:00 | K-Faktor | 1,0208 | 2851 |
| 959 | Store Kufjord | M2 | 10.03.2019 15:00:00 | K-Faktor | 1,0714 | 2821 |
| 959 | Store Kufjord | M2 | 10.03.2019 15:00:00 | Pigment | 5,11 | 2831 |
| 959 | Store Kufjord | M3 | 10.03.2019 15:00:00 | Pigment | 5,89 | 2861 |
| 1048 | Brensholmen 37357 | 05 (TD) | 26.03.2019 10:41:22 | K-Faktor | 1,158 | 2446 |
| 1048 | Brensholmen 37357 | 05 (TD) | 26.03.2019 10:41:22 | Pigment | 3,971428571 | 2456 |
| 1067 | Næringsbukta | N1 (D) | 01.09.2019 13:19:28 | K-Faktor | 1,29 | 1276 |
| 1067 | Næringsbukta | N1 (D) | 01.09.2019 13:19:28 | Pigment | 5,08 | 1286 |
| 1072 | Store Kufjord | M3 | 10.03.2019 15:00:00 | Pigment | 4,81 | 2876 |
| 1072 | Store Kufjord | M3 | 10.03.2019 15:00:00 | K-Faktor | 1,084 | 2866 |
| 1136 | Danielsvika | 12 | 05.09.2019 15:00:00 | K-Faktor | 1,2047 | 991 |
| 1136 | Danielsvika | 12 | 05.09.2019 15:00:00 | Pigment | 4,9 | 1001 |
| 1136 | Danielsvika | 07 | 05.09.2019 15:00:00 | K-Faktor | 1,2047 | 1171 |
| 1136 | Danielsvika | 07 | 05.09.2019 15:00:00 | Pigment | 4,9 | 1181 |
| 1136 | Danielsvika | 03 | 05.09.2019 15:00:00 | Pigment | 4,9 | 1106 |
| 1136 | Danielsvika | 03 | 05.09.2019 15:00:00 | K-Faktor | 1,2047 | 1096 |
| 1136 | Danielsvika | 02 | 05.09.2019 15:00:00 | K-Faktor | 1,2047 | 1036 |
| 1136 | Danielsvika | 02 | 05.09.2019 15:00:00 | Pigment | 4,9 | 1046 |
| 1182 | Brensholmen 37357 | 07 (TD) | 26.03.2019 10:41:22 | K-Faktor | 1,2337 | 2461 |
| 1182 | Brensholmen 37357 | 07 (TD) | 26.03.2019 10:41:22 | Pigment | 4,295238095 | 2471 |
| 1216 | Store Kobbøya | 15-04-C | 19.03.2019 15:00:00 | Pigment | 4,74 | 2711 |
| 1216 | Store Kobbøya | 01-21-A | 19.03.2019 15:00:00 | K-Faktor | 1,1628 | 2671 |
| 1216 | Store Kobbøya | 09-D | 19.03.2019 15:00:00 | K-Faktor | 1,1628 | 2686 |
| 1216 | Store Kobbøya | 01-21-A | 19.03.2019 15:00:00 | Pigment | 4,74 | 2681 |
| 1216 | Store Kobbøya | 05-19-M | 19.03.2019 15:00:00 | K-Faktor | 1,1628 | 2596 |
| 1216 | Store Kobbøya | 15-04-C | 19.03.2019 15:00:00 | K-Faktor | 1,1628 | 2701 |
| 1216 | Store Kobbøya | 09-D | 19.03.2019 15:00:00 | Pigment | 4,74 | 2696 |
| 1216 | Store Kobbøya | 08-B | 19.03.2019 15:00:00 | Pigment | 4,74 | 2591 |
| 1216 | Store Kobbøya | 08-B | 19.03.2019 15:00:00 | K-Faktor | 1,1628 | 2581 |
| 1216 | Store Kobbøya | 05-19-M | 19.03.2019 15:00:00 | Pigment | 4,74 | 2606 |
| 1286 | No Location | No Cage | 16.05.2019 15:00:00 | Pigment | 4,23 | 2216 |
| 1286 | No Location | No Cage | 16.05.2019 15:00:00 | K-Faktor | 1,1077 | 2206 |
| 1326 | Store Kvalfjord | 05-06 | 17.04.2019 15:00:00 | K-Faktor | 1,1503 | 2341 |
| 1326 | Store Kvalfjord | 05-06 | 17.04.2019 15:00:00 | Pigment | 5,12 | 2351 |
| 1326 | Store Kvalfjord | 01-02 | 17.04.2019 15:00:00 | Pigment | 5,12 | 2336 |
| 1326 | Store Kvalfjord | 01-02 | 17.04.2019 15:00:00 | K-Faktor | 1,1503 | 2326 |
2 Replies
- daxCommunity Support
Hi Anonymous ,
I am not sure whether this is hwta you want, you could refer to my sample for details. If this is not what you want, please correct me and inform me more detailed information.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Actually it should do an union of both slicers. But the most important thing to solve for me is the dax code
I want to have data for line chart based on group column. I have to use Avgweight on the x axis and Value on y axis. But before that I need to fix my dax measure so I have only one value per group and per avg weight. Look below the avg weights of 959 for K-Faktor have 3 values. The dax code should pick one of them, either min or max. Doing so we can use min index or value of couse. I thought to create several measures like this one per group item. Hope you can help
Measure 12 =VAR myValue = IF("Fett" IN VALUES('Y akse 1'[Measurement 1]);MINX (FILTER (SELECTCOLUMNS (FILTER ( Table2; Table2[Group] = "Fett" );"index"; Table2[Index];"Min"; MINX (FILTER ( Table2; Table2[Group] = EARLIER ( Table2[Group] ) );Table2[Value]));[index] = MAX ( Table2[Index] ));[Min]);BLANK())RETURN myValueAvgWeight Location Cage SampleDate Group Value Index 902 Danielsvika 02 26.02.2019 15:00:00 K-Faktor 1,2368 18 902 Danielsvika 02 26.02.2019 15:00:00 Fett 9,02 19 959 Store Kufjord M3 10.03.2019 15:00:00 Fett 7,26 21 959 Store Kufjord M3 10.03.2019 15:00:00 K-Faktor 1,0208 22 959 Store Kufjord M2 10.03.2019 15:00:00 Fett 7,26 24 959 Store Kufjord M2 10.03.2019 15:00:00 K-Faktor 1,0208 25 959 Store Kufjord M2 10.03.2019 15:00:00 Fett 5,86 27 959 Store Kufjord M2 10.03.2019 15:00:00 K-Faktor 1,0714 28 1048 Brensholmen 37357 05 (TD) 26.03.2019 10:41:22 K-Faktor 1,158 33 1048 Brensholmen 37357 05 (TD) 26.03.2019 10:41:22 Fett 11,31428571 34 1067 Næringsbukta N1 (D) 01.09.2019 13:19:28 Fett 8,16 37 1067 Næringsbukta N1 (D) 01.09.2019 13:19:28 K-Faktor 1,29 38 1072 Store Kufjord M3 10.03.2019 15:00:00 K-Faktor 1,084 39 1072 Store Kufjord M3 10.03.2019 15:00:00 Fett 6,96 41 1136 Danielsvika 12 05.09.2019 15:00:00 Fett 8,49 42 1136 Danielsvika 07 05.09.2019 15:00:00 K-Faktor 1,2047 45 1136 Danielsvika 03 05.09.2019 15:00:00 Fett 8,49 47 1136 Danielsvika 03 05.09.2019 15:00:00 K-Faktor 1,2047 48 1136 Danielsvika 02 05.09.2019 15:00:00 Fett 8,49 50 1136 Danielsvika 07 05.09.2019 15:00:00 Fett 8,49 51 1136 Danielsvika 02 05.09.2019 15:00:00 K-Faktor 1,2047 52 1136 Danielsvika 12 05.09.2019 15:00:00 K-Faktor 1,2047 53 1182 Brensholmen 37357 07 (TD) 26.03.2019 10:41:22 K-Faktor 1,2337 54 1182 Brensholmen 37357 07 (TD) 26.03.2019 10:41:22 Fett 13,87142857 55 1216 Store Kobbøya 09-D 19.03.2019 15:00:00 K-Faktor 1,1628 58 1216 Store Kobbøya 09-D 19.03.2019 15:00:00 Fett 9,63 59 1216 Store Kobbøya 15-04-C 19.03.2019 15:00:00 K-Faktor 1,1628 61 1216 Store Kobbøya 01-21-A 19.03.2019 15:00:00 Fett 9,63 62 1216 Store Kobbøya 15-04-C 19.03.2019 15:00:00 Fett 9,63 63 1216 Store Kobbøya 08-B 19.03.2019 15:00:00 Fett 9,63 64 1216 Store Kobbøya 05-19-M 19.03.2019 15:00:00 K-Faktor 1,1628 66 1216 Store Kobbøya 05-19-M 19.03.2019 15:00:00 Fett 9,63 67 1216 Store Kobbøya 08-B 19.03.2019 15:00:00 K-Faktor 1,1628 70 1216 Store Kobbøya 01-21-A 19.03.2019 15:00:00 K-Faktor 1,1628 71 1286 No Location No Cage 16.05.2019 15:00:00 Fett 7,3 72 1286 No Location No Cage 16.05.2019 15:00:00 K-Faktor 1,1077 73 1326 Store Kvalfjord 01-02 17.04.2019 15:00:00 K-Faktor 1,1503 76 1326 Store Kvalfjord 01-02 17.04.2019 15:00:00 Fett 9,31 77 1326 Store Kvalfjord 05-06 17.04.2019 15:00:00 K-Faktor 1,1503 78 1326 Store Kvalfjord 05-06 17.04.2019 15:00:00 Fett 9,31 79