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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
yaguaso
Frequent Visitor

sum of several measurements in a single column with 9 values, Power BI

Hello community. I am trying to show the sum of several measurements in a single column with 9 values,

yaguaso_0-1704982513955.png

 

but it gives me an error that says: Mdxscript(Model) (385.9) Calculation error in measure 'CALCULOS' [MOSTRAR actividades]: A multi-value table was provided where a single value was expected.

The formula entered is:

Mostrar Actividades =

    SWITCH (VALUES(ACTIVIDADES[POSICION]),

        1, [A1 Variable],

        2, [A2 Variable],

        3, [A3 Variable],

        4, [A4 Variable],

        5, [A5 Variable],

        6, [A6 Variable],

        7, [A7 Variable],

        8, [A8 Variable],

        9, [A9 Variable],

    15

)

 

Could someone help me determine what is wrong?

 

1 ACCEPTED SOLUTION
yaguaso
Frequent Visitor

Thanks for the help, but solved the problem using the following measurement:

MOSTRAR_ACTIV =
 IF(HASONEVALUE(ACTIVIDADES[POSICION]),
SWITCH(VALUES(ACTIVIDADES[POSICION]),
 1, [A1 Variable],
 2, [A2 Variable],
 3, [A3 Variable],
 4, [A4 Variable],
 5, [A5 Variable],
 6, [A6 Variable],
 7, [A7 Variable],
 8, [A8 Variable],
 9, [A9 Variable],
 10
 ))
 

View solution in original post

2 REPLIES 2
yaguaso
Frequent Visitor

Thanks for the help, but solved the problem using the following measurement:

MOSTRAR_ACTIV =
 IF(HASONEVALUE(ACTIVIDADES[POSICION]),
SWITCH(VALUES(ACTIVIDADES[POSICION]),
 1, [A1 Variable],
 2, [A2 Variable],
 3, [A3 Variable],
 4, [A4 Variable],
 5, [A5 Variable],
 6, [A6 Variable],
 7, [A7 Variable],
 8, [A8 Variable],
 9, [A9 Variable],
 10
 ))
 
Anonymous
Not applicable

Hi @yaguaso ,

You can update the formula of measure [Mostrar Actividades] as below and check if it can return the expected result...

Mostrar Actividades =
SWITCH (
    SELECTEDVALUE ( ACTIVIDADES[POSICION] ),
    1, [A1 Variable],
    2, [A2 Variable],
    3, [A3 Variable],
    4, [A4 Variable],
    5, [A5 Variable],
    6, [A6 Variable],
    7, [A7 Variable],
    8, [A8 Variable],
    9, [A9 Variable],
    15
)

Best Regards

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.