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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
aaabbbccc
New Member

Chart to show 0's in line graph

I have this:

aaabbbccc_0-1653404265855.png

using this data:

CustomerOrderNumberOrderNumberCustomerPONumberCreateDateCreateDateOnly
83885943289100HOT SHOT1/24/2022 22:201/24/2022 22:20
83886064289373HOT SHOT1/25/2022 14:111/25/2022 14:11
83887779292932HOT SHOT2/7/2022 1:452/7/2022 1:45
83888338294157HOT SHOT2/10/2022 5:442/10/2022 5:44
83892719303884HOT SHOT3/12/2022 16:063/12/2022 16:06
83892982304435HOT SHOT3/15/2022 0:503/15/2022 0:50
83893278305193HOT SHOT3/16/2022 17:363/16/2022 17:36
83893305305231HOT SHOT3/16/2022 20:593/16/2022 20:59
83896233311015HOT SHOT4/5/2022 9:064/5/2022 9:06
83896277311217HOT SHOT4/5/2022 18:564/5/2022 18:56
83896327311234HOT SHOT4/5/2022 21:264/5/2022 21:26
83896466311548HOT SHOT4/6/2022 22:274/6/2022 22:27
83896473311557HOT SHOT4/7/2022 0:474/7/2022 0:47
83896864312342HOT SHOT4/11/2022 1:424/11/2022 1:42
83897025312670HOT SHOT4/11/2022 23:474/11/2022 23:47
83897056312700HOT SHOT4/12/2022 3:204/12/2022 3:20
83897464313681HOT SHOT4/15/2022 0:414/15/2022 0:41
83898225315474HOT SHOT4/22/2022 5:024/22/2022 5:02
83898286315609HOT SHOT4/22/2022 14:494/22/2022 14:49
83898558316216HOT SHOT4/25/2022 21:324/25/2022 21:32
83898565316230HOT SHOT4/25/2022 23:024/25/2022 23:02
83898720316540HOT SHOT4/26/2022 21:304/26/2022 21:30
83898772316608HOT SHOT4/27/2022 5:504/27/2022 5:50
83898938316934HOT SHOT4/28/2022 3:164/28/2022 3:16
83899038317232HOT SHOT4/28/2022 20:464/28/2022 20:46
83899440318054HOT SHOT5/2/2022 22:475/2/2022 22:47
83899773318998HOT SHOT5/4/2022 20:415/4/2022 20:41
83899855319094HOT SHOT5/5/2022 7:385/5/2022 7:38
83900167319944HOT SHOT5/9/2022 3:015/9/2022 3:01
83901309322356HOT SHOT5/18/2022 6:455/18/2022 6:45
83901698323417HOT SHOT5/21/2022 21:085/21/2022 21:08
83901699323418HOT SHOT5/21/2022 21:135/21/2022 21:13
83901700323419HOT SHOT5/21/2022 21:135/21/2022 21:13
83901720323466HOT SHOT5/22/2022 13:085/22/2022 13:08

 

and my line graph only goes to 1, not to 0.  The Y axis is set to:

aaabbbccc_1-1653404477801.png

In researching I found that a common solution is If I change the line graph from "Count of CustomerOrderNumber" to:

 

Measure 2 = count(ShipmentOrder[CustomerOrderNumber])+0
 
but that just makes my graph stop respecting the date filters:
aaabbbccc_2-1653405324113.png

I am at a real loss for what I assume is a simple solution.  Any help would be greatly appreciated!

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @aaabbbccc ;

You could create another table as x-axis.

Date = CALENDAR(MIN('Table'[CreateDate]),MAX('Table'[CreateDate]))

Then create a measure.

Measure = CALCULATE(COUNT('Table'[CustomerOrderNumber]),FILTER('Table',FORMAT([CreateDate],"yyyy-mm-dd")=FORMAT(MAX('Date'[Date]),"yyyy-mm-dd")))+0

The final show:

vyalanwumsft_0-1653632210481.png


Best Regards,
Community Support Team _ Yalan Wu
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
v-yalanwu-msft
Community Support
Community Support

Hi, @aaabbbccc ;

You could create another table as x-axis.

Date = CALENDAR(MIN('Table'[CreateDate]),MAX('Table'[CreateDate]))

Then create a measure.

Measure = CALCULATE(COUNT('Table'[CustomerOrderNumber]),FILTER('Table',FORMAT([CreateDate],"yyyy-mm-dd")=FORMAT(MAX('Date'[Date]),"yyyy-mm-dd")))+0

The final show:

vyalanwumsft_0-1653632210481.png


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

aaabbbccc
New Member

If I set the Y axis to zero, then it shows zero:

aaabbbccc_0-1653406718825.png

but since there are no values that are actually 0 it doesn't "dip like it should".  In the example above I would expect the line to be at 0 from 5/10-5/17 because there are no orders that qualify.

 

Greg_Deckler
Super User
Super User

@aaabbbccc You can force the y-axis to start at zero.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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