Forum Discussion
Line chart will only display dots - no lines
- Anonymous2 years ago
Hi CH_MJR79
Please refer to the following solution.
Sample data
2022
2023
The relationship
Create a measure
Measure = SWITCH(TRUE(),SELECTEDVALUE('Date'[Dates].[Year])=2022,SUM('2022'[Total]),SELECTEDVALUE('Date'[Dates].[Year])=2023,SUM('2023'[Total]))Then just input the date column and measure to the visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yes of course. Please see below:
The data source is an Excel sheet with four tabs - one for each of the years:
This is the separate Years table:
These are the relationships:
And the X and Y axis:
Hi CH_MJR79
As Gayatri_D05 mentioned, you can create one measure then put it to the Y-axis.
e.g
Measure =
SWITCH (
TRUE (),
SELECTEDVALUE ( 'Years'[Year] ) = 2020, SUM ( '2020'[Sales] ),
SELECTEDVALUE ( 'Years'[Year] ) = 2021, SUM ( '2021'[Sales] ),
SELECTEDVALUE ( 'Years'[Year] ) = 2022, SUM ( '2022'[Sales] ),
SELECTEDVALUE ( 'Years'[Year] ) = 2023, SUM ( '2023'[Sales] )
)
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- CH_MJR792 years agoHelper II
I would need the four measures (or be able to represent the four measures on the Y-Axis.
Anonymous when I added your example measure it didn't display anything unfortunately:This is the formula I used:
Measure =SWITCH(TRUE(),SELECTEDVALUE('Years'[Year]) = 2020, SUM('2020'[SalesCodes-2020]),SELECTEDVALUE('Years'[Year]) = 2021, SUM('2021'[SalesCodes-2021]),SELECTEDVALUE('Years'[Year]) = 2022, SUM('2022'[SalesCodes-2022]),SELECTEDVALUE('Years'[Year]) = 2023, SUM('2023'[SalesCodes-2023]))For reference, this is what the SalesCodes formulas look like:SalesCodes-2020 = IF(AND('2020'[Account] >= 1, '2020'[Account] <= 10), '2020'[Year End 30/6/2020], BLANK())*-1
Many thanks for your help on this so far.- CH_MJR792 years agoHelper II
I thought it might help if I put some screenshots below of the way the line chart appears, along with a screenshot of the data source.
I have mocked this up by entering some dummy data manually into the tables.
1. This is how the chart currently looks with the dots above each other:
2. This is the data in the table:
- CH_MJR792 years agoHelper II
I have just created a new file, entered some dummy data and then added a line chart.
This line chart also just displays the coloured dots - no lines joining them up.
I am obviously doing something wrong but can't seem to work out what.
Here are the screenshots of the new file:
1. The chart:
2. The tables:
2022:
2023:
Date:
3. Relationships: