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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
KCfromDC
Frequent Visitor

Show continuous line in graph of count over year/quarter (no more dots!)

I have a line graph that has some categories with no values for certain quarters, so I'm seeing periodic "dots" and disconnected lines. Data is a huge table, but in essence, I'm counting the number of antibiotics given per Age Group by Quarter and Year, marked as such:

Date

Age Group

AB

03/01/2024

20-29

0

18/01/2024

30-39

1

04/02/2024

40-49

0

15/02/2024

40-49

1

01/03/2024

50-59

1

05/03/2024

50-59

1

17/03/2024

60-69

1

20/03/2024

70-79

0

28/03/2024

80+

0

 

 

Here's what an aggregated version would look like:

Year/QuarterQuarterAge groupAB count
2024120-290

2024

1

30-39

1
2024140-491
2024150-592
2024160-691
2024170-790
2024180+0

 

Y axis is the count of AB, X axis is the year and then the quarter underneath. Years range from 2014 -2024:

KCfromDC_5-1728362855982.png

 

How do I get it so any quarters with a 0 count go back to the X axis as, well, 0? See below for example:

 

KCfromDC_7-1728362898765.png

 

I've tried two ways: one, using the regular Date in the main table and drilling down, or making a separate date table. Even if I get rid of Quarter and make Year categorical, it still presents disconnected lines:

KCfromDC_9-1728363761700.png

 

1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Hi @KCfromDC 

 

I have taken your sample data. so i am getting this result before calculation.

 

Uzi2019_3-1728384206274.png

 

follow these steps:

1: create calendar table  and add quater column to it

Uzi2019_0-1728383852436.png

 

 

2: then create a measure with following logic:

Count AB= 

Count AB = Sum('Blood Grp'[AB])+0

Step3: add your chart take values from calendar table on X-axis and count Ab measure value on Y axis. and age group on legends


Uzi2019_2-1728384126036.png

 

I hope i answered your question!

 

 


 

 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

3 REPLIES 3
Uzi2019
Super User
Super User

Hi @KCfromDC 

 

I have taken your sample data. so i am getting this result before calculation.

 

Uzi2019_3-1728384206274.png

 

follow these steps:

1: create calendar table  and add quater column to it

Uzi2019_0-1728383852436.png

 

 

2: then create a measure with following logic:

Count AB= 

Count AB = Sum('Blood Grp'[AB])+0

Step3: add your chart take values from calendar table on X-axis and count Ab measure value on Y axis. and age group on legends


Uzi2019_2-1728384126036.png

 

I hope i answered your question!

 

 


 

 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Brilliant, thank you!

MFelix
Super User
Super User

Hi @KCfromDC ,

 

Not sure how you have your data in the visual but you should add a 0 to your calculation so when it's blank it will return 0.

 

This can be achieved using a +0 in the end of the measure or a COALESCE syntax.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors