Forum Discussion
How to create a summary table for Sankey chart?
I possess data similar to the images shown. I aim to develop a Sankey chart that incorporates date and product ID filters. The data involves a many-to-one relationship connecting 'Redeem_start,' 'Redeem_fail_type_1,' 'Redeem_fail_type_2,' and 'success_redeem' with 'users' and 'calendar,' linked through 'user_id' and 'date.' I've compiled a summary table, but it isn't functioning as anticipated, as it erroneously includes data from Stage 2 in the calculations for Stage 1.
Sankey_Data =
UNION(
SELECTCOLUMNS(
Reward_Started_Summary,
"User ID", 'Reward_Started_Summary'[user_id],
"Product ID", 'Reward_Started_Summary'[product_id],
"Date", 'Reward_Started_Summary'[Date],
"Stage 1", "Reward Started",
"Stage 2", "Reward Started",
"Reason", BLANK(), // Since there's no reason in the start stage
"Count", 'Reward_Started_Summary'[Count]
),
SELECTCOLUMNS(
Failed_Reward_Summary,
"User ID", 'Failed_Reward_Summary'[user_id],
"Product ID", 'Failed_Reward_Summary'[product_id],
"Date", 'Failed_Reward_Summary'[Date],
"Stage 1", BLANK(),
"Stage 2", "Reward Failed",
"Reason", 'Failed_Reward_Summary'[reason],
"Count", 'Failed_Reward_Summary'[Count]
),
SELECTCOLUMNS(
Catalog_Redeem_Summary,
"User ID", 'Success Redeem'[user_id],
"Product ID", 'Success Redeem'[product_id],
"Date", 'Success Redeem_Summary'[Date],
"Stage 1", "Reward Started",
"Stage 2", "Success Redeem",
"Reason", "Success Redeem",
"Count", 'Catalog_Redeem_Summary'[Count]
)
)
1 Reply
- lbendlin
Super User
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523