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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PetrK
Helper II
Helper II

Different result of measure and calculated column

Hi All,

I have measure nad calculated column with same formula. Measure return correct values but column just blank values.
Coud you explain me why and how to change formula in column to get same result?
Thank you

this is my formula:

Project PM Hours distibution weeks C = 
var current_Opp_No = SELECTEDVALUE('PM Hours distribution'[Opportunity_Number])
var current_Project_Month_no = SELECTEDVALUE('PM Hours distribution'[Project Month])
var weeks = 
    COUNTROWS(
        FILTER(
            ALL('PM Hours distribution'[Opportunity_Number], 'PM Hours distribution'[Project Month], 'PM Hours distribution'[Date]),
            'PM Hours distribution'[Opportunity_Number]=current_Opp_No && 'PM Hours distribution'[Project Month]= current_Project_Month_no)
            ) 

return
IF(weeks = 0 , BLANK() ,
MIN('PM Hours distribution'[Project PM hours distribution month]) * MIN('PM Hours distribution'[PM hours]) / weeks)

 

1 ACCEPTED SOLUTION
TomasAndersson
Solution Sage
Solution Sage

Hi!
Instead of 

 

var current_Opp_No = SELECTEDVALUE('PM Hours distribution'[Opportunity_Number])
var current_Project_Month_no = SELECTEDVALUE('PM Hours distribution'[Project Month])

 

try

 

var current_Opp_No = 'PM Hours distribution'[Opportunity_Number]
var current_Project_Month_no = 'PM Hours distribution'[Project Month]

 

I.e. by not using SELECTEDVALUE(). I can't say if that's all, but it would be one reason that you get a blank when trying to create a calculated column. Hope this helps!

View solution in original post

2 REPLIES 2
TomasAndersson
Solution Sage
Solution Sage

Hi!
Instead of 

 

var current_Opp_No = SELECTEDVALUE('PM Hours distribution'[Opportunity_Number])
var current_Project_Month_no = SELECTEDVALUE('PM Hours distribution'[Project Month])

 

try

 

var current_Opp_No = 'PM Hours distribution'[Opportunity_Number]
var current_Project_Month_no = 'PM Hours distribution'[Project Month]

 

I.e. by not using SELECTEDVALUE(). I can't say if that's all, but it would be one reason that you get a blank when trying to create a calculated column. Hope this helps!

Hi @TomasAndersson ,

great thank you, additionally I remove both MIN from last row and now it is working.

 

Thank you 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.