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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
tspoon
Frequent Visitor

Line chart, keeping one of the x-axis for reference of the other x-axis value

Dear all,

Another help needed for Line Chart.

 

How to keep one the x-axis which showing 15 weeks Plan value (0-100%) while the other x-axis showing value of the the selected week from the slicer?

 

Here’s the goal expected:

This page showing values of the first to fifth week if we select 5th week from the slicer:

tspoon_2-1721276051266.png

(right image: hovering to the last Actual value)

 

This page showing values of the first to sixth week if we select 6th week from the slicer:

tspoon_3-1721276093489.png

(right image: hovering to the last Actual value)

 

Many thank's in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tspoon 

 

My solution is as follows, you can try it out.

 

  1. Here are the columns included in my example table. The “plan” and “actual” here represent the percentage.  1.png
  2. Create a new table using the following DAX : Table2 = SELECTCOLUMNS('Table',"week",'Table'[week], "weeknum", 'Table'[weeknum])  2.png
  3. Create a measure for actual progress using the following DAX: ActualMeasure = CALCULATE(SUM('Table'[actual]), FILTER('Table', 'Table'[weeknum] <= MAX('Table2'[weeknum])))  
  4. Create a line chart, put the “week” of the “Table” table into the X-axis, and the “plan” of the “Table” table and the new metrics created in the previous step into the Y-axis. Create a slicer, put the “week” of the “Table” table into the X-axis, and the “plan” of the “Table” table into the Y-axis. Table2” into Field.  4-1.png4-2.png
  5. Select the measure used in the Y-axis and format it to percentage under the Measure tools tab.  5.png
  6. Here is my final test result.   6.png

    I hope this solution meets your requirements.

     

     

    Best Regards,

    Jarvis Tang

    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

3 REPLIES 3
Anonymous
Not applicable

Hi @tspoon 

 

My solution is as follows, you can try it out.

 

  1. Here are the columns included in my example table. The “plan” and “actual” here represent the percentage.  1.png
  2. Create a new table using the following DAX : Table2 = SELECTCOLUMNS('Table',"week",'Table'[week], "weeknum", 'Table'[weeknum])  2.png
  3. Create a measure for actual progress using the following DAX: ActualMeasure = CALCULATE(SUM('Table'[actual]), FILTER('Table', 'Table'[weeknum] <= MAX('Table2'[weeknum])))  
  4. Create a line chart, put the “week” of the “Table” table into the X-axis, and the “plan” of the “Table” table and the new metrics created in the previous step into the Y-axis. Create a slicer, put the “week” of the “Table” table into the X-axis, and the “plan” of the “Table” table into the Y-axis. Table2” into Field.  4-1.png4-2.png
  5. Select the measure used in the Y-axis and format it to percentage under the Measure tools tab.  5.png
  6. Here is my final test result.   6.png

    I hope this solution meets your requirements.

     

     

    Best Regards,

    Jarvis Tang

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

     

Hi @Anonymous ,

 

Thanks for solution, it's really help me to understand the concept.

But still there is one problem. After I add W10 as new data, the line chart (x-axis) is not sorting well, even after I set "weeknum" for  "sort by column" in the "table view". 

tspoon_0-1721616621307.png

 

 

tspoon
Frequent Visitor

Found it!

Select "three dots (more options)" from the visual, select "sort axis" then select the "plan" and also select "ascending".

 

Thanks

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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