The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all,
Say I have a table as shown below:
* 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:
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!
Solved! Go to Solution.
Hi @Anonymous ,
First you need to unpivot the columns.
Select these three columns at the same time and click Unpivot Columns.
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.
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]))
2.Changing interaction
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.
Hi @Anonymous ,
First you need to unpivot the columns.
Select these three columns at the same time and click Unpivot Columns.
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.
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]))
2.Changing interaction
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.
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.