Forum Discussion
Repeat every value for each id
- Anonymous5 years ago
Hi Anonymous ,
Please following these steps:
1. Add a column whose value is 1 and a column which group ID and Type in table:
Value = 1IDType = [ID] & [Type]2. Create a calculated table using the following formula:
Table 2 = VAR _tab = ADDCOLUMNS ( CROSSJOIN ( ALL ( 'Table'[ID] ), ALL ( 'Table'[Type] ) ), "IDType", [ID] & [Type] ) RETURN ADDCOLUMNS ( _tab, "Re", VAR _val = LOOKUPVALUE ( 'Table'[Value], 'Table'[IDType], [IDType] ) RETURN IF ( _val = BLANK (), 0, _val ) )My final output looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.Best Regards,
Eyelyn Qin
Hi Anonymous ,
Please following these steps:
1. Add a column whose value is 1 and a column which group ID and Type in table:
Value = 1 IDType =
[ID] & [Type]
2. Create a calculated table using the following formula:
Table 2 =
VAR _tab =
ADDCOLUMNS (
CROSSJOIN ( ALL ( 'Table'[ID] ), ALL ( 'Table'[Type] ) ),
"IDType", [ID] & [Type]
)
RETURN
ADDCOLUMNS (
_tab,
"Re",
VAR _val =
LOOKUPVALUE ( 'Table'[Value], 'Table'[IDType], [IDType] )
RETURN
IF ( _val = BLANK (), 0, _val )
)My final output looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin