Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
jeff569
Frequent Visitor

Using a different weight in the last level of Sankey Chart

Hi Guys
I am creating a sankey chart that analyzes the electricity consumption. There are a total of 6 levels in the chart, and the weights used is the sum of consumption data. In the last level I want the data from the previous level to be multiplied by a value that can be changed dynamically by a parameter. This multiplied value is to be used as the weight that connects the 5th level and the 6th level. while I am trying to do this using the below attached code PowerBI automatically picks up the default value assigned and returns the weight in the last level and dynamic setting of the parameter doesnt work. The entire setup works seperately when I use a card to see the working. Can anyone please help me with this issue please.

 

I am using 1 parameter and  3 measures here: 

 

1. StandardConsumption = SUM('Final (Trial)'[Consumption])

2. SelectedMultiplier =
    SELECTEDVALUE('Parameter'[Parameter], 1)
3. MultipliedConsumption =
SUMX(
    'Final (Trial)',
    'Final (Trial)'[Consumption] * [SelectedMultiplier]
)
 

This is the Dax I am using to create my sankey chart:
SankeyData =
UNION(
SELECTCOLUMNS(
'Final (Trial)',
"Source", 'Final (Trial)'[Year],
"Destination", 'Final (Trial)'[Month],
"Year", 'Final (Trial)'[Year],
"Month", 'Final (Trial)'[Month],
"Consumption", [StandardConsumption] // Standard Consumption
),
SELECTCOLUMNS(
'Final (Trial)',
"Source", 'Final (Trial)'[Month],
"Destination", 'Final (Trial)'[Meter],
"Year", 'Final (Trial)'[Year],
"Month", 'Final (Trial)'[Month],
"Consumption", [StandardConsumption] 
),
SELECTCOLUMNS(
'Final (Trial)',
"Source", 'Final (Trial)'[Meter],
"Destination", 'Final (Trial)'[Sub_Station],
"Year", 'Final (Trial)'[Year],
"Month", 'Final (Trial)'[Month],
"Consumption", [StandardConsumption] // Standard Consumption
),
SELECTCOLUMNS(
'Final (Trial)',
"Source", 'Final (Trial)'[Sub_Station],
"Destination", 'Final (Trial)'[Division],
"Year", 'Final (Trial)'[Year],
"Month", 'Final (Trial)'[Month],
"Consumption", [StandardConsumption]
),
SELECTCOLUMNS(
'Final (Trial)',
"Source", 'Final (Trial)'[Division],
"Destination", LOOKUPVALUE('eMI'[Emission], 'eMI'[Division], 'Final (Trial)'[Division]),
"Year", 'Final (Trial)'[Year],
"Month", 'Final (Trial)'[Month],
"Consumption", [MultipliedConsumption] 
)
)

5 REPLIES 5
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...

This is a sample of the data strucutre. I want the sankey to go like: year->Month->Meter->consumption-> Sub_Station->Division->Emission. I want the weight between all the levels to be Consumption but at the last level Division->Emission to be consumption*parameter.
Data Table 1 (Final (Trial)):

Year Consumption Month Sub_Station EM NumberDivision
201818960JanuarySS3EM-216-SMDB-01SF6
201816217FebruarySS3EM-216-SMDB-01SF6
201820029MarchSS3EM-216-SMDB-01SF6
201823520AprilSS3EM-216-SMDB-01SF6
201824564MaySS3EM-216-SMDB-01SF6
201824289JuneSS3EM-216-SMDB-01SF6
201826426JulySS3EM-216-SMDB-01SF6
201825667AugustSS3EM-216-SMDB-01SF6
201820659SeptemberSS3EM-216-SMDB-01SF6
201821308OctoberSS3EM-216-SMDB-01SF6
201821392NovemberSS3EM-216-SMDB-01SF6
201815469DecemberSS3EM-216-SMDB-01SF6
201915265JanuarySS3EM-216-SMDB-01SF6
201914951FebruarySS3EM-216-SMDB-01SF6
201916666MarchSS3EM-216-SMDB-01SF6
201917710AprilSS3EM-216-SMDB-01SF6
201921727MaySS3EM-216-SMDB-01SF6
201921881JuneSS3EM-216-SMDB-01SF6
201922369JulySS3EM-216-SMDB-01SF6
201920399AugustSS3EM-216-SMDB-01SF6
201925053SeptemberSS3EM-216-SMDB-01SF6
201923051OctoberSS3EM-216-SMDB-01SF6
201921593NovemberSS3EM-216-SMDB-01SF6
201918952DecemberSS3EM-216-SMDB-01SF6

 

Data Table 2(eMI):

Emission Division
CO2 SF6SF6
CO2 AegisAEGIS
CO2 OILOIL
CO2 FZEFZE

 

 

I don't see a parameter column.

 

Instead of a Sankey maybe use a Decomposition tree?

Thank you for the response but my boss is keen on using Sankey is there way to achieve my expected reuslts using sankey itself. 
my parameter table looks like :

Parameter
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
3
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
4
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
5
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.9

Your first sample table (Final (Trial)) has all the same values in the last three columns.  I don't see how you can get any chart out of that, let alone a Sankey chart.  Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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