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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
_Regina
Helper I
Helper I

Line Chart shows a spike at the end

_Regina_0-1657637877717.png

Hi Everyone,

I have this line chart. This is the view when I selected June,30,2022 on my date slicer. It shows me results for July 31 2022 and adds up all the data points thus giving me a spike. Unsure as to what mught be causing this. if I have the latest date selected, For example July 12, it gives me correct chart. but if I have a previous date selected it shows me data beyond that date, which is not expected.

The measures used are structured as below

Clients with Gross Sales =

var _start_date = CALCULATE(MIN('_date unpivot'[Date Key]))
var _end_date = CALCULATE(MAX('_date unpivot'[Date Key]))

var r = CALCULATE(
DISTINCTCOUNT('client'[Client ID]),
DATESBETWEEN('transaction'[Processing Date], _start_date, _end_date),
'transaction'[Transaction Category] = "Gross Sales"
 
)

return r
 
 
I would really appreciate any direction here. Thank you
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@_Regina , Try if this can work

var _start_date = CALCULATE(MIN('_date unpivot'[Date Key]))
var _end_date = CALCULATE(MAX('_date unpivot'[Date Key]))

var r = CALCULATE(
DISTINCTCOUNT('client'[Client ID]),
filter('transaction', 'transaction'[Processing Date]>= _start_date && 'transaction'[Processing Date] <= _end_date),
'transaction'[Transaction Category] = "Gross Sales"

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@_Regina , Try if this can work

var _start_date = CALCULATE(MIN('_date unpivot'[Date Key]))
var _end_date = CALCULATE(MAX('_date unpivot'[Date Key]))

var r = CALCULATE(
DISTINCTCOUNT('client'[Client ID]),
filter('transaction', 'transaction'[Processing Date]>= _start_date && 'transaction'[Processing Date] <= _end_date),
'transaction'[Transaction Category] = "Gross Sales"

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you once again, but why would your solution work and not mine ?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.