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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Changing calculated column to a measure

I have created below calculated column, and would like to make it as a calculated measure. How could i do it?
 
Change(vs Last Survey) = var _date= maxx(filter('Survey Data Scores(%)', 'Survey Data Scores(%)'[Facility Name + ID] = earlier('Survey Data Scores(%)'[Facility Name + ID]) && 'Survey Data Scores(%)'[Survey Close Date] < earlier('Survey Data Scores(%)'[Survey Close Date]) ), 'Survey Data Scores(%)'[Survey Close Date])

var _score='Survey Data Scores(%)'[Question]- maxx(filter('Survey Data Scores(%)', 'Survey Data Scores(%)'[Facility Name + ID] = earlier('Survey Data Scores(%)'[Facility Name + ID]) && 'Survey Data Scores(%)'[Survey Close Date] =_date ), 'Survey Data Scores(%)'[Question])
return

IF('Survey Data Scores(%)'[Current/Last]="Current Survey", IF(_score='Survey Data Scores(%)'[Question],0,ROUND(_score,1) ))
1 REPLY 1
amitchandak
Super User
Super User

@Anonymous, try like

 

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

var _score=max('Survey Data Scores(%)'[Question])- maxx(filter(allselected('Survey Data Scores(%)'), 'Survey Data Scores(%)'[Facility Name + ID] = max('Survey Data Scores(%)'[Facility Name + ID]) && 'Survey Data Scores(%)'[Survey Close Date] =_date ), 'Survey Data Scores(%)'[Question])
return

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

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.