# Curve function use date table as x axis

Please see attached my pbix file.

sigmaroughie.pbix (193.6 KB)

I have a line as measure called CurveFunc plotted on a line graph.

The function only outputs correctly if I use a separate table for the x axis or a measure (generateseries). See example in PBIX file CurveFunc2 graph showing incorrectly.
In this example, the x axis starts and finishes at the same index as CurveFunc0 (start -7 and finish +7) except the values are entirely different. Why is this?

My problem: How can I plot CurveFunc0 using dates table as the x axis?

Iâ€™m able to create the x axis values dynamically using powerquery in scurvedummydata but no point if not possible to plot against the main date table.

Bumping this post for more visibility.

Hi @izzleee - Difference b/w using Index/Dates from disconnected separate table and Lookup/Fact table is of Filter context. In lookup/Fact table, scurvedummydata gets filtered for the selected date/index thus affecting the FinalCost value while in Disconnected table it will always give sum of all rows.

For using Date as X-Axis, try using below DAX expression. Similarly can use Index column from scurvedummydata table as done in CurveFunc2 in file
sigmaroughie.pbix (194.8 KB)

``````CurveFunc4 = -- sigmoid curve using start and finish values

var initCost = 0

var FinalCost = CALCULATE(SUM(scurvedummydata[Cost]),all(dates))

var sigmoidFunction = 1 / (1 + EXP(1)^-LASTNONBLANK(scurvedummydata[index], 1)) -- this list needs 0 as midpoint

var result = initCost + (FinalCost-initCost)*sigmoidFunction

return if(ISBLANK(sum(scurvedummydata[Cost])),BLANK(),result)
``````

Thanks
Ankit J

3 Likes

Thank you so much for that detailed answer @ankit

We hope this helped you @izzleee

If not, how far did you get and what kind of help you need further?

If yes, kindly mark as solution the answer that solved your query.

Hi @izzleee due to inactivity, a response on this post has been tagged as â€śSolutionâ€ť. If you have any concern related to this topic, please create a new thread.