Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
MClipsham92
Frequent Visitor

Line Graph data points filtering off of previous data point

Hello All,

 

I have a line graph which shows the sum of the overall score of students on assessments at 3 different assessment points. However the number of students completing the assessment can change between assessment points. How do I filter the line graph so that it only includes overall scores from student which were in the last assessment point? 

 

Currently I have this:

Line Graph.PNG

 

As we can see next to the visual level filters in the lowwer right I have 17 students at Link Teacher Score 1, 16 at Link Teacher Score 2 and 18 at Link Teacher score 3. How do I make it so the same 16 students are used for all 3?

 

Data looks like this:

 

Identifier Score 1 Score 2 Score 3 Score 4 Overall Score

Student             3          4           1            5                 13

 

Thanks,

 

Mark.

1 ACCEPTED SOLUTION

Thanks for your reply.

 

I've already unpivotted all of the data to make it work as a Line Chart, this was not the issue.

 

The issue was limiting the line chart to only use data from students that have completed all three assessment points. I've managed to solve it by writing the following DAX for a new column and then using this column as a visual level filter in the Line Chart, seems a bit inelegant but looks like it works;

 

Appears in All surveys = 
 VAR a= IF('Link Teacher'[Attribute]="Link Teacher Score 3",MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 1"),'Link Teacher'[Score]),MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 1"),'Link Teacher'[Score]))
  VAR b= IF('Link Teacher'[Attribute]="Link Teacher Score 2",MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 2"),'Link Teacher'[Score]),MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 2"),'Link Teacher'[Score]))
  VAR c= IF('Link Teacher'[Attribute]="Link Teacher Score 1",MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 3"),'Link Teacher'[Score]),MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 3"),'Link Teacher'[Score]))
  RETURN IF(ISBLANK(a),BLANK(),IF(ISBLANK(b),BLANK(),IF(ISBLANK(c),BLANK(),"In all 3")))

Thanks,

 

Mark.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @MClipsham92 ,

You can do unpivot columns function on your table to convert multiple scores and value columns to attribute and value.
Drag score attribute to legend fields, value to value field of line chart, then you can see all scores types.

Unpivot Data Using Excel Power Query

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thanks for your reply.

 

I've already unpivotted all of the data to make it work as a Line Chart, this was not the issue.

 

The issue was limiting the line chart to only use data from students that have completed all three assessment points. I've managed to solve it by writing the following DAX for a new column and then using this column as a visual level filter in the Line Chart, seems a bit inelegant but looks like it works;

 

Appears in All surveys = 
 VAR a= IF('Link Teacher'[Attribute]="Link Teacher Score 3",MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 1"),'Link Teacher'[Score]),MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 1"),'Link Teacher'[Score]))
  VAR b= IF('Link Teacher'[Attribute]="Link Teacher Score 2",MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 2"),'Link Teacher'[Score]),MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 2"),'Link Teacher'[Score]))
  VAR c= IF('Link Teacher'[Attribute]="Link Teacher Score 1",MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 3"),'Link Teacher'[Score]),MAXX(FILTER('Link Teacher','Link Teacher'[Identifier]=EARLIER('Link Teacher'[Identifier])&&'Link Teacher'[Attribute]="Link Teacher Score 3"),'Link Teacher'[Score]))
  RETURN IF(ISBLANK(a),BLANK(),IF(ISBLANK(b),BLANK(),IF(ISBLANK(c),BLANK(),"In all 3")))

Thanks,

 

Mark.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.