Forum Discussion
Standard S-Curve Measure
- 4 years ago
Cracked it! Exciting DAX fun to be honest which needs some explanation as to why the stuff I sent worked in isolation but not in your solution.
Your date table is related to a number of fact tables which contain blank dates. In order to deal with that in a strong relationship DAX introduces a blank row into your date table behind the scenes. (Blank row in DAX - SQLBI)
When the date slicer is present and has a selection made the blank row is filtered out.
When the date slicer is present but it's set at the lowest value the blank row remains.
The EXP function is basically saying it doesn't know how to calculate e^BLANK which is fair enough!
First solution was to put in a page filter to remove the blank row:
Better solution is update the DAX to deal with the situation:
CM_ROW_Tax Card Baseline S-Curve = VAR k = .18 VAR a = .43 VAR MinVal = 0 VAR MaxVal = 10000 VAR StartDate = CALCULATE( MIN ( dimCalendar[Date] ), ALLSELECTED ( dimCalendar[Date] )) VAR EndDate = CALCULATE( MAX ( dimCalendar[Date] ), ALLSELECTED ( dimCalendar[Date] )) VAR CurrentDate = SELECTEDVALUE( dimCalendar[Date] ) VAR XVal = CurrentDate - StartDate VAR MaxXVal = EndDate - StartDate VAR MeanXVal = MaxXVal/2 VAR Result = IF( NOT ISBLANK(CurrentDate), MinVal + (MaxVal - MinVal) * DIVIDE ( 1, (1 + EXP(-1*k*( XVal- MeanXVal )))^a ) ) RETURN Result
In terms of the impact of the parameters I'd just based it on the formula in the blog you sent. I'll have another read and ponder on it.
The information I have is:
How many widgets need to be created
Start date of creating widgets
End date of creating widgets
Could you provide a sample file or some sample data? And please provide your desired outcome based on your sample. I'll try to solve it. Thanks.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.