Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello community. I am trying to show the values of nine measurements [Ai=1..,9 Variable] in a single column, as show:
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
Solved! Go to Solution.
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:
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.
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:
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:
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...
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |