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
e175429
Helper IV
Helper IV

Creating Line Charts

Hello all,

 

I have survey data with 3 questions. In PowerBi, I need to recreate 3 line charts based on each question, like the ones below:

 

This chart is based on question "How satisfied were you with your response?"

The data dark blue points show the avarage answers of "Extremely satisfied" and the orange data points show the average answers of "not at all satisfied" by month/year.

image001 (1).png

 

This chart is based on the question "How satisfied were you with the CX team?"

The data dark blue points show the avarage answers of "Extremely satisfied" and the orange data points show the average answers of "not at all satisfied" by month/year.

image002 (1).png

 

This chartis based on the question "Do you feel our team answered your inquiry promptly?"

The data points show the average "Yes" answer by month.

image003.png

 

Here is a copy of my data:

  Data 

I don't know how to upload PowerBi files otherwise I would have uploaded that. And when I tried to upload the excel file, it says "The file type (.xlsx) is not supported.". Therefor I had to upload it in Google sheets. 

  

Any help on the steps I would need to take to create these line charts in PowerBi will be most appreciated. 

  

Thank you! 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

In the attached file, I tried to select certain answers per each question, and then turn on Trend line feature in the format pane for each visualization.

 

Jihwan_Kim_1-1732076507590.png

 

 

Jihwan_Kim_0-1732076492647.png

 

Q1 %: = 
VAR _allresponse =
    CALCULATE (
        [Count response:],
        REMOVEFILTERS ( Question_fact[how satisfied were you with your response?] )
    )
VAR _target = [Count response:]

RETURN
    DIVIDE ( _target, _allresponse )

 

Q2 %: = 
VAR _allresponse =
    CALCULATE (
        [Count response:],
        REMOVEFILTERS ( Question_fact[how satisfied were you with our CX Team?] )
    )
VAR _target = [Count response:]

RETURN
    DIVIDE ( _target, _allresponse )

 

Q3 %: = 
VAR _allresponse =
    CALCULATE (
        [Count response:],
        REMOVEFILTERS ( Question_fact[Do you feel that our team answered your inquiry promptly?] )
    )
VAR _target = [Count response:]

RETURN
    DIVIDE ( _target, _allresponse )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

In the attached file, I tried to select certain answers per each question, and then turn on Trend line feature in the format pane for each visualization.

 

Jihwan_Kim_1-1732076507590.png

 

 

Jihwan_Kim_0-1732076492647.png

 

Q1 %: = 
VAR _allresponse =
    CALCULATE (
        [Count response:],
        REMOVEFILTERS ( Question_fact[how satisfied were you with your response?] )
    )
VAR _target = [Count response:]

RETURN
    DIVIDE ( _target, _allresponse )

 

Q2 %: = 
VAR _allresponse =
    CALCULATE (
        [Count response:],
        REMOVEFILTERS ( Question_fact[how satisfied were you with our CX Team?] )
    )
VAR _target = [Count response:]

RETURN
    DIVIDE ( _target, _allresponse )

 

Q3 %: = 
VAR _allresponse =
    CALCULATE (
        [Count response:],
        REMOVEFILTERS ( Question_fact[Do you feel that our team answered your inquiry promptly?] )
    )
VAR _target = [Count response:]

RETURN
    DIVIDE ( _target, _allresponse )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hello, 

I'm back with a follow-up question.

 

If you look at the file you uploaded, and hover over any of the data points, you'll see that the Months don't match up wth the dates on the axis.

e175429_5-1737059244187.png

 

I have this fixable by putting "Month-Year" on the x-axis instead of "Month-Year sort".

e175429_6-1737059418592.png

 

 

However, when I put Month-Year, the Trend option disappears from the format pane so I can't put the trend line back.

 

Is there a workaround to this? To have the dates match up on the x-axis and include trend lines?

 

Thank you!

 

Hello,

 

Please ignore my previous question. To get rid of the drop down i had to turn off "Auto date/time" under Time Intelligence in the settings.

 

Thank you very much.

 

Regards

 

 

Hello,

 

So, I'm not sure why but when I created the Calendar table, my "Month-Year-sort" has a dropdown and yours does not, and I copied your code exactly.

Your code and table:

e175429_0-1732227714957.png

e175429_3-1732227810360.png

 

 

My code and table:

e175429_1-1732227741426.png

e175429_2-1732227790450.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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