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

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

Reply
SteveIOW
Helper II
Helper II

Table of multiple values error

Good morning.

 

I have created a measure with two variables, the output of which is dependent on a selection from another table.

 

ActivityActual =

VAR vActW = CALCULATE(SUM(MainFacts[Value]), MainFacts[MetricType] = "Activity", MainFacts[DataSource] = "WAR MH", MainFacts[Frequency] = "Weekly")
VAR vActM = CALCULATE(SUM(MainFacts[Value]), MainFacts[MetricType] = "Activity", MainFacts[DataSource] = "DM01 MH", MainFacts[Frequency] = "Monthly")


RETURN
IF('DataF' = "Monthly", vActM, vActW)
 
The measure works fine if I Return either vActM or vActW.
 
The field DataF is in a table with only two values in it - Weekly or Monthly.
SteveIOW_1-1650612292003.png

 

The same process works in other measures I have created. but in this one I get the error...
SteveIOW_0-1650612242206.png

 I am completely stuck. can any one help please?

 

Kind regards

 

Steve

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Try changing IF('DataF' = "Monthly", vActM, vActW) to IF(SELECTEDVALUE('TableName'[ColumnName]) = "Monthly", vActM, vActW). Change 'TableName'[ColumnName]  to the actual table and column names.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

In addition, that is because your measure expects a single or scalar value. Column 'DataF' is a column and is not a single value. The workaround is to wrap it in a functoin that will return and a single value which doesn't necessarily aggreate like MAX, MIN, SELECTEDVALUE. This functions will return just about the same value on a by row basis but not when it comes to the total. Took me some time too to figure out when I was a novice Power BI user.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
danextian
Super User
Super User

Try changing IF('DataF' = "Monthly", vActM, vActW) to IF(SELECTEDVALUE('TableName'[ColumnName]) = "Monthly", vActM, vActW). Change 'TableName'[ColumnName]  to the actual table and column names.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

spot on - thank you so much

 

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Kudoed Authors