Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi all,
is it posible to add rows in a base like this:
| ID | Year | Month | Client | Label | Value | concatenate ID&Client |
| 1 | 2018 | 1 | cosmin | A | 1 | 1cosmin |
| 1 | 2018 | 1 | cosmin | B | 1 | 1cosmin |
| 1 | 2018 | 1 | cosmin | C | 1 | 1cosmin |
| 1 | 2018 | 1 | cosmin | D | 0 | 1cosmin |
| 2 | 2018 | 2 | cosmin | A | 0 | 2cosmin |
| 2 | 2018 | 2 | cosmin | B | 1 | 2cosmin |
| 2 | 2018 | 2 | cosmin | C | 1 | 2cosmin |
| 2 | 2018 | 2 | cosmin | D | 0 | 2cosmin |
| 3 | 2018 | 1 | ana | A | 0 | 3ana |
| 3 | 2018 | 1 | ana | B | 0 | 3ana |
| 3 | 2018 | 1 | ana | C | 0 | 3ana |
| 3 | 2018 | 1 | ana | D | 1 | 3ana |
| 4 | 2018 | 3 | ana | A | 0 | 4ana |
| 4 | 2018 | 3 | ana | B | 1 | 4ana |
| 4 | 2018 | 3 | ana | C | 1 | 4ana |
| 4 | 2018 | 3 | ana | D | 1 | 4ana |
| add custom rows | ||||||
| 1 | 2018 | 1 | cosmin | Z | 0 | 1cosmin |
| 2 | 2018 | 2 | cosmin | Z | 0 | 2cosmin |
| 3 | 2018 | 1 | ana | Z | 0 | 3ana |
| 4 | 2018 | 3 | ana | Z | 1 | 4ana |
| If(Value for C=1 ann D=1 --value for new row is 1, otherwise os 0 |
the real base has thousands of rows and need to make something for each ID&Client
any idea?
Thanks,
Cosmin
Solved! Go to Solution.
Hi COSMINC,
You could try to new custom row table by DAX like below
custom rows =
SUMMARIZE (
cutsom,
cutsom[ID],
cutsom[Year],
cutsom[Month],
cutsom[client],
cutsom[concatenate ID&Client],
"value", IF (
CALCULATE (
SUM ( cutsom[Value] ),
FILTER (
ALLEXCEPT ( cutsom, cutsom[ID] ),
cutsom[Label] = "C"
|| cutsom[Label] = "D"
)
) = 2,
1,
0
),
"Label", "Z"
)Then use selectcolumn and union syntax to combine two table like below
Table 2 =
UNION (
cutsom,
SELECTCOLUMNS (
'custom rows',
"id", 'custom rows'[ID],
"year", 'custom rows'[Year],
"Month", 'custom rows'[Month],
"client", 'custom rows'[client],
"lable", 'custom rows'[Label],
"value", 'custom rows'[value],
"con", 'custom rows'[concatenate ID&Client]
)
)Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi COSMINC,
You could try to new custom row table by DAX like below
custom rows =
SUMMARIZE (
cutsom,
cutsom[ID],
cutsom[Year],
cutsom[Month],
cutsom[client],
cutsom[concatenate ID&Client],
"value", IF (
CALCULATE (
SUM ( cutsom[Value] ),
FILTER (
ALLEXCEPT ( cutsom, cutsom[ID] ),
cutsom[Label] = "C"
|| cutsom[Label] = "D"
)
) = 2,
1,
0
),
"Label", "Z"
)Then use selectcolumn and union syntax to combine two table like below
Table 2 =
UNION (
cutsom,
SELECTCOLUMNS (
'custom rows',
"id", 'custom rows'[ID],
"year", 'custom rows'[Year],
"Month", 'custom rows'[Month],
"client", 'custom rows'[client],
"lable", 'custom rows'[Label],
"value", 'custom rows'[value],
"con", 'custom rows'[concatenate ID&Client]
)
)Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks,
very very helpfull!
Cosmin
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 34 | |
| 32 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 71 | |
| 38 | |
| 35 | |
| 25 |