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.
Hello,
I'm trying to write a logic where i need to calculate a measure based on specific weeks as shown below. However i end up either getting one of the following errors
"A single value for column in table cannot be determined power bi" or
"The expression refers to multiple columns Multiple columns cannot be converted to scalar value"
If(
Table[FY_Year_Weeknum]<202248,
Measure1,
Measure2
)
Solved! Go to Solution.
@Madhun , You have to use selectedvalue or max
If(
selectedvalues(Table[FY_Year_Weeknum])<202248,
Measure1,
Measure2
)
or
If(
max(Table[FY_Year_Weeknum])<202248,
Measure1,
Measure2
)
Hi @Madhun ,
It seems you are creating a measure, please update the formula of your measure as below. Please find the details in the attachment.
Measure = IF ( SELECTEDVALUE ( 'Table'[FY_Year_Weeknum] ) < 202248, [Measure1], [Measure2] ) |
In addition, you can review the following blog to get a better understanding of why you are getting this DAX error message.
DAX error messages in Power BI
Best Regards
Hi @Madhun ,
It seems you are creating a measure, please update the formula of your measure as below. Please find the details in the attachment.
Measure = IF ( SELECTEDVALUE ( 'Table'[FY_Year_Weeknum] ) < 202248, [Measure1], [Measure2] ) |
In addition, you can review the following blog to get a better understanding of why you are getting this DAX error message.
DAX error messages in Power BI
Best Regards
@v-yiruan-msft ,
Thank you for your response. I used the same logic and it worked for me 🙂
@Madhun , You have to use selectedvalue or max
If(
selectedvalues(Table[FY_Year_Weeknum])<202248,
Measure1,
Measure2
)
or
If(
max(Table[FY_Year_Weeknum])<202248,
Measure1,
Measure2
)
@amitchandak
Thanks for the response. Selectedvalue() function did the job for me 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
97 | |
75 | |
65 | |
53 |
User | Count |
---|---|
144 | |
103 | |
98 | |
85 | |
64 |