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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
unnijoy
Post Prodigy
Post Prodigy

Line chart

I need to creata a line chart from the below table. Line 1 should give me the distint count of user name based on True in column named "Learning Plan Completed". And Line 2 should give me distint count of user name based on Yes in column named "Course COMPLETED". Here am facing an issue with a common date for setting as X axis. i got two dates column named "Learning Plan Completed Date" & "Course DATE_COMPLETED.  i need to get a idea to get month on X axis and it should have a connection with colums "Learning Plan Completed Date" & "Course DATE_COMPLETED". 

 

USERNAMELearning Plan CompletedLearning Plan Completed DateCourse COMPLETEDCourse DATE_COMPLETED
CHRISTOPHER.PEERSFALSE NO 
danielle.mclarnonFALSE YES02/08/2019
leighann.worrallFALSE NO 
rebecca.curranTRUE02/06/2019YES01/10/2019
steven.fraserFALSE YES02/11/2019
john.campbellFALSE NO 
cormac.sweeneyFALSE YES01/16/2019
ANDREW.SCHOFIELDFALSE NO 
danielle.mclarnonFALSE NO 
CHRISTOPHER.PEERSFALSE NO 
leighann.worrallFALSE NO 
rebecca.curranTRUE02/06/2019YES01/31/2019
steven.fraserFALSE NO 
john.campbellFALSE NO 
cormac.sweeneyFALSE NO 
ANDREW.SCHOFIELDFALSE NO 
danielle.mclarnonFALSE NO 
danielle.mclarnonFALSE NO 
CHRISTOPHER.PEERSFALSE NO 
CHRISTOPHER.PEERSFALSE NO 
rebecca.curranTRUE02/06/2019YES01/18/2019
steven.fraserFALSE NO 
john.campbellFALSE NO 
cormac.sweeneyFALSE NO 
ANDREW.SCHOFIELDFALSE NO 
leighann.worrallFALSE NO 
rebecca.curranTRUE02/06/2019NO 
john.campbellFALSE YES06/15/2018
steven.fraserFALSE NO 
leighann.worrallFALSE NO 
ANDREW.SCHOFIELDFALSE NO 
cormac.sweeneyFALSE NO 
danielle.mclarnonFALSE YES06/15/2018
CHRISTOPHER.PEERSFALSE NO 
john.campbellFALSE NO 
ANDREW.SCHOFIELDFALSE YES04/23/2017
cormac.sweeneyFALSE YES12/05/2018
steven.fraserFALSE YES02/20/2018
leighann.worrallFALSE NO 
rebecca.curranTRUE02/06/2019YES01/30/2019
danielle.mclarnonFALSE NO 
2 ACCEPTED SOLUTIONS
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @unnijoy ,

 

New a calendar table which is unrelated to fact data table.

Date dim =
CALENDAR (
    MIN (
        MIN ( Sheet5[Learning Plan Completed Date] ),
        MIN ( Sheet5[Course DATE_COMPLETED] )
    ),
    MAX (
        MAX ( Sheet5[Learning Plan Completed Date] ),
        MAX ( Sheet5[Course DATE_COMPLETED] )
    )
)

Add [Date] from 'Date dim' table onto chart axis. Create measures as below to get the distinct count of user name.

Count True =
CALCULATE (
    DISTINCTCOUNT ( Sheet5[USERNAME] ),
    FILTER (
        ALL ( Sheet5 ),
        Sheet5[Learning Plan Completed] = "TRUE"
            && Sheet5[Learning Plan Completed Date].[Year]
                = SELECTEDVALUE ( 'Date dim'[Date].[Year] )
            && Sheet5[Learning Plan Completed Date].[MonthNo]
                = SELECTEDVALUE ( 'Date dim'[Date].[MonthNo] )
    )
)

Count Yes =
CALCULATE (
    DISTINCTCOUNT ( Sheet5[USERNAME] ),
    FILTER (
        ALL ( Sheet5 ),
        Sheet5[Course COMPLETED] = "YES"
            && Sheet5[Course DATE_COMPLETED].[Year] = SELECTEDVALUE ( 'Date dim'[Date].[Year] )
            && Sheet5[Course DATE_COMPLETED].[MonthNo]
                = SELECTEDVALUE ( 'Date dim'[Date].[MonthNo] )
    )
)

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

Hi @v-yulgu-msft 

 

Thanks for your reply. For the graph is ging blank. 

Do i need to set the relationship with new table and existing table fields

View solution in original post

5 REPLIES 5
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @unnijoy ,

 

New a calendar table which is unrelated to fact data table.

Date dim =
CALENDAR (
    MIN (
        MIN ( Sheet5[Learning Plan Completed Date] ),
        MIN ( Sheet5[Course DATE_COMPLETED] )
    ),
    MAX (
        MAX ( Sheet5[Learning Plan Completed Date] ),
        MAX ( Sheet5[Course DATE_COMPLETED] )
    )
)

Add [Date] from 'Date dim' table onto chart axis. Create measures as below to get the distinct count of user name.

Count True =
CALCULATE (
    DISTINCTCOUNT ( Sheet5[USERNAME] ),
    FILTER (
        ALL ( Sheet5 ),
        Sheet5[Learning Plan Completed] = "TRUE"
            && Sheet5[Learning Plan Completed Date].[Year]
                = SELECTEDVALUE ( 'Date dim'[Date].[Year] )
            && Sheet5[Learning Plan Completed Date].[MonthNo]
                = SELECTEDVALUE ( 'Date dim'[Date].[MonthNo] )
    )
)

Count Yes =
CALCULATE (
    DISTINCTCOUNT ( Sheet5[USERNAME] ),
    FILTER (
        ALL ( Sheet5 ),
        Sheet5[Course COMPLETED] = "YES"
            && Sheet5[Course DATE_COMPLETED].[Year] = SELECTEDVALUE ( 'Date dim'[Date].[Year] )
            && Sheet5[Course DATE_COMPLETED].[MonthNo]
                = SELECTEDVALUE ( 'Date dim'[Date].[MonthNo] )
    )
)

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft ,

The line graph is working fine. But i have filters based on Geography & Country. I am getting the overall data on the graph. But the graph is not changing based on filter selection. Below am attaching a sample data. Please help.

 

USERNAMECOUNTRYRegionLearning Plan CompletedLearning Plan Completed DateCourse COMPLETEDCourse DATE_COMPLETED
CHRISTOPHER.PEERSCanadaNorth AmericaFALSE NO 
leighann.worrallCanadaNorth AmericaFALSE YES3/10/2019
rebecca.curranCanadaNorth AmericaTRUE02/06/2019YES1/10/2019
steven.fraserCanadaNorth AmericaFALSE YES2/11/2019
denitsa.hristovaBulgariaEuropeTRUE03/19/2019YES3/9/2019
Dilyana.kirilovaBulgariaEuropeFALSE YES3/18/2019
mac.condinoPhilippinesPhilippinesTRUE03/12/2019YES3/8/2019
ALISONN.ENTUNAPhilippinesPhilippinesTRUE03/17/2019YES3/12/2019
myles.catolosPhilippinesPhilippinesTRUE03/24/2019YES3/23/2019
gergana.milanovaBulgariaEuropeFALSE YES3/5/2019
elitsa.zheleva1BulgariaEuropeFALSE YES2/22/2019
emilia.trifonovaBulgariaEuropeFALSE NO 
luminita.giurgiuBulgariaEuropeFALSE YES2/25/2019
valentin.monovskiBulgariaEuropeFALSE NO 
ADRIAN.PRAPORGESCUBulgariaEuropeFALSE YES2/15/2019
daniel.tereshtenkovBulgariaEuropeFALSE NO 
frederic.gakoyaBulgariaEuropeFALSE NO 
mihail.ilievBulgariaEuropeFALSE NO 
boryana.stoyanovaBulgariaEuropeFALSE NO 
henrieta.muziyskaBulgariaEuropeFALSE YES4/1/2019
yoana.trendafilovaBulgariaEuropeFALSE NO 
john.campbellUKEuropeFALSE NO 
cormac.sweeneyUKEuropeFALSE YES1/16/2019
ANDREW.SCHOFIELDUKEuropeFALSE NO 
danielle.mclarnonUKEuropeFALSE YES2/8/2019
ADRIAN.PRAPORGESCUBulgariaEuropeFALSE NO 
CHRISTOPHER.PEERSCanadaNorth AmericaFALSE NO 
leighann.worrallCanadaNorth AmericaFALSE NO 
cormac.sweeneyUKEuropeFALSE NO 
frederic.gakoyaBulgariaEuropeFALSE NO 
mihail.ilievBulgariaEuropeFALSE NO 
yoana.trendafilovaBulgariaEuropeFALSE NO 
valentin.monovskiBulgariaEuropeFALSE NO 
myles.catolosPhilippinesPhilippinesTRUE03/24/2019YES3/23/2019
ALISONN.ENTUNAPhilippinesPhilippinesTRUE03/17/2019YES3/17/2019
rebecca.curranCanadaNorth AmericaTRUE02/06/2019YES1/31/2019
steven.fraserCanadaNorth AmericaFALSE YES3/11/2019
john.campbellUKEuropeFALSE NO 
henrieta.muziyskaBulgariaEuropeFALSE NO 
gergana.milanovaBulgariaEuropeFALSE NO 
elitsa.zheleva1BulgariaEuropeFALSE NO 
emilia.trifonovaBulgariaEuropeFALSE NO 
luminita.giurgiuBulgariaEuropeFALSE NO 
mac.condinoPhilippinesPhilippinesTRUE03/12/2019YES3/10/2019
ANDREW.SCHOFIELDUKEuropeFALSE NO 
danielle.mclarnonUKEuropeFALSE NO 
daniel.tereshtenkovBulgariaEuropeFALSE NO 
denitsa.hristovaBulgariaEuropeTRUE03/19/2019YES3/13/2019
Dilyana.kirilovaBulgariaEuropeFALSE NO 

 

Hi @v-yulgu-msft ,

 

Any help with this will be great.

Hi @v-yulgu-msft 

 

Thanks for your reply. For the graph is ging blank. 

Do i need to set the relationship with new table and existing table fields

hi @v-yulgu-msft 

 

Thanks you so much. Please discard my last reply. It was my mistake. when i slect the x axis. Now it is working fine. Good day

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.