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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Visualize Line Chart

Hi all,

Say I have a table as shown below:

kingzhionchan98_0-1633310647951.png

* 1=pass, 0=fail;

I want to develop a line chart that will shows the average pass rate for every tests(1-3). 

*As shown as image below:

kingzhionchan98_1-1633310999704.png

Could it be done like this : When I click at the slicer, the line chart will reflect to tell me which test the user passed/failed?

Could it be done by creating new table or using DAX command?

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

First you need to unpivot the columns. 

Select these three columns at the same time and click Unpivot Columns.

1.png

2.png

 

Then create the measure and visuals. 

Measure = CALCULATE(AVERAGE('Table'[Value]),FILTER(ALLSELECTED('Table'),[Attribute]=MAX('Table'[Attribute])))

 

The results in the line chart can be changed according to the selection of the slicer.

3.png4.png

 

If you want the line graph to be unaffected by the slicer, there are two solutions, one is to change the DAX, and the other is to change the interaction.

1.Changing DAX with ALLEXCEPT

New Measure = CALCULATE(AVERAGE('Table'[Value]),ALLEXCEPT('Table','Table'[Attribute]))

6.png

 

2.Changing interaction

7.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

First you need to unpivot the columns. 

Select these three columns at the same time and click Unpivot Columns.

1.png

2.png

 

Then create the measure and visuals. 

Measure = CALCULATE(AVERAGE('Table'[Value]),FILTER(ALLSELECTED('Table'),[Attribute]=MAX('Table'[Attribute])))

 

The results in the line chart can be changed according to the selection of the slicer.

3.png4.png

 

If you want the line graph to be unaffected by the slicer, there are two solutions, one is to change the DAX, and the other is to change the interaction.

1.Changing DAX with ALLEXCEPT

New Measure = CALCULATE(AVERAGE('Table'[Value]),ALLEXCEPT('Table','Table'[Attribute]))

6.png

 

2.Changing interaction

7.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

I do created another table for the line chart.

Example:

Test  | Pass Rate

Test1| 90%

Test2| 80%

Test3| 100%

 

The line chart will not interact with the slicer because there are no relationships between the two tables.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors