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
Hayoung
Helper IV
Helper IV

return "-" as the change if there is no last result data

My code below return the change(current result-last result) for most case. However, if there is no last result data, then it will return the current result instead of the change. How could i just return "-" if this case?

 

Q Change(vs Last Survey) = var _date= maxx(filter('Survey Data Score', 'Survey Data Scores(%)'[Facility Name + ID] = earlier('Survey Data Score'[Facility Name + ID]) && 'Survey Data Scores(%)'[Survey Close Date] < earlier('Survey Data Score'[Survey Close Date]) ), 'Survey Data Score'[Survey Close Date])

 

var _score='Survey Data Score'[question]- maxx(filter('Survey Data Score', 'Survey Data Score'[Facility Name + ID] = earlier('Survey Data Score'[Facility Name + ID]) && 'Survey Data Score'[Survey Close Date] =_date ), 'Survey Data Score'[question])

return

 

IF('Survey Data Score'[Current/Last]="Current Survey", IF(_score='Survey Data Scores(%)'[question],0,ROUND(_score,1) ))

1 REPLY 1
v-zhangti
Community Support
Community Support

Hi, @Hayoung 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures. I look forward to your response.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.