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

Measurements in a single column with 9 values, Power BI

Hello community. I am trying to show the values of nine measurements [Ai=1..,9 Variable] in a single column, as show:

 

yaguaso_0-1705782781367.png

 

 

 

 but I get an error, in line 14, with the variable posic, after using the following formula:

 

1 MOSTRAR_ACTIV = SUMX(ACTIVIDADES,

2 VAR _Indx =[POSICION]

3 VAR posic =

4 IF(_Indx = 1, [A1 Variable],

5 IF(_Indx = 2, [A2 Variable],

6 IF(_Indx = 3, [A3 Variable],

7 IF(_Indx = 4, [A4 Variable],

8 IF(_Indx = 5, [A5 Variable],

9 IF(_Indx = 6, [A6 Variable],

10 IF(_Indx = 7, [A7 Variable],

11 IF(_Indx = 8, [A8 Variable],

12 IF(_Indx = 9, [A9 Variable],

13 SWITCH( TRUE(),

14 IF(_Indx<=9, posic

)))))))))))

 

I tried with another formula:

 

1 MOSTRAR_ACTIV =

2  SWITCH (

3         SELECTEDVALUE(ACTIVIDADES[POSICION]),

4        1, [A1 Variable],

5        2, [A2 Variable],

6        3, [A3 Variable],

7        4, [A4 Variable],

8        5, [A5 Variable],

9        6, [A6 Variable],

10       7, [A7 Variable],

11       8, [A8 Variable],

12       9, [A9 Variable],

13       150

14 )

No errors, but show only the value 150 of line 13.

Could someone help me determine what is wrong?

Thanks, before hands

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @yaguaso ,

 

You can change the dax to the following form:

Column =
SWITCH(
    'Table'[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],150)

Result:

vyangliumsft_0-1705889146066.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @yaguaso ,

 

You can change the dax to the following form:

Column =
SWITCH(
    'Table'[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],150)

Result:

vyangliumsft_0-1705889146066.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I solved this problem using the following measure:

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
 ))
Thanks for the help
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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