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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
MarianaL
New Member

Help displaying data from different sources in one graphic

I have data from three different sources : municipalities, departments and regions (French geography). 

I want the user to select different municipalities. 

Then I would like to display one graphic showing : 

- the aggregated data for all the municipalities selected (average, sum, or different calculations in function of the data) --> I have calculated measures in order to get those aggregated values

- the data for each municipality selected

- the data for the department of the selected municipalities

- the data for the region of the selected municipalities

- the data for the whole country 

However, for the moment, I'm only able to display one graphic per item : one graphic for the agreggated municipalities, one for all the municipalities, etc...

 

Here is the link to my document : https://drive.google.com/file/d/1ssCtPiPmy9etZ7z1F4cg0BBvZ2sWyhAj/view?usp=sharing

 

Thank you for your help!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MarianaL ,

I checked out your pbix file, but am a bit skeptical about your needs.

1.What is the scope of 'data'? Just the corresponding 'Department' and 'Region' names? Or all the data in the corresponding row?

- the data for the department of the selected municipalities

- the data for the region of the selected municipalities

 Please use the 'RELATED' function

RELATED function (DAX) - DAX | Microsoft Learn

Departement = MAXX('Communes_2022',RELATED(Departements_2022[LIBELLE]))
Region = MAXX('Communes_2022',RELATED('Régions_2022'[LIBELLE]))

2.Please use the 'CONCATENATEX' function.

CONCATENATEX function (DAX) - DAX | Microsoft Learn

the data for each municipality selected
Data = CONCATENATEX('Communes_2022','Communes_2022'[LIBELLE] & UNICHAR(10) & 'Communes_2022'[Ville, Région, Département, France]) 

vzhouwenmsft_0-1729748828942.png

3.I noticed that you can only show '2021' data here, if you want to show data for the other two years, please create the table manually and create the measures based on my expression instead of using the quick measure

vzhouwenmsft_1-1729748966965.png

vzhouwenmsft_2-1729748991042.png

0-14 = 
VAR _slicer = SELECTEDVALUE('Table'[Year])
RETURN 
SWITCH(TRUE(),
_slicer = 2010,SUM('Evol_Struc_Pop_2010'[Pop 0-14 ans en 2010 (princ)]),
_slicer = 2015,SUM(Evol_Struc_Pop_2015[Pop 0-14 ans en 2015 (princ)]),
_slicer = 2021,SUM(Evol_Struct_Pop_2021[Pop 0-14 ans en 2021 (princ)])
)
15-29 = 
VAR _slicer = SELECTEDVALUE('Table'[Year])
RETURN 
SWITCH(TRUE(),
_slicer = 2010,SUM('Evol_Struc_Pop_2010'[Pop 15-29 ans en 2010 (princ)]),
_slicer = 2015,SUM(Evol_Struc_Pop_2015[Pop 15-29 ans en 2015 (princ)]),
_slicer = 2021,SUM(Evol_Struct_Pop_2021[Pop 15-29 ans en 2021 (princ)])
)

vzhouwenmsft_3-1729749072059.png

 

 I can't upload your file to the forums because it's too big.

 

Best Regards,
Wenbin Zhou

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @MarianaL ,

I checked out your pbix file, but am a bit skeptical about your needs.

1.What is the scope of 'data'? Just the corresponding 'Department' and 'Region' names? Or all the data in the corresponding row?

- the data for the department of the selected municipalities

- the data for the region of the selected municipalities

 Please use the 'RELATED' function

RELATED function (DAX) - DAX | Microsoft Learn

Departement = MAXX('Communes_2022',RELATED(Departements_2022[LIBELLE]))
Region = MAXX('Communes_2022',RELATED('Régions_2022'[LIBELLE]))

2.Please use the 'CONCATENATEX' function.

CONCATENATEX function (DAX) - DAX | Microsoft Learn

the data for each municipality selected
Data = CONCATENATEX('Communes_2022','Communes_2022'[LIBELLE] & UNICHAR(10) & 'Communes_2022'[Ville, Région, Département, France]) 

vzhouwenmsft_0-1729748828942.png

3.I noticed that you can only show '2021' data here, if you want to show data for the other two years, please create the table manually and create the measures based on my expression instead of using the quick measure

vzhouwenmsft_1-1729748966965.png

vzhouwenmsft_2-1729748991042.png

0-14 = 
VAR _slicer = SELECTEDVALUE('Table'[Year])
RETURN 
SWITCH(TRUE(),
_slicer = 2010,SUM('Evol_Struc_Pop_2010'[Pop 0-14 ans en 2010 (princ)]),
_slicer = 2015,SUM(Evol_Struc_Pop_2015[Pop 0-14 ans en 2015 (princ)]),
_slicer = 2021,SUM(Evol_Struct_Pop_2021[Pop 0-14 ans en 2021 (princ)])
)
15-29 = 
VAR _slicer = SELECTEDVALUE('Table'[Year])
RETURN 
SWITCH(TRUE(),
_slicer = 2010,SUM('Evol_Struc_Pop_2010'[Pop 15-29 ans en 2010 (princ)]),
_slicer = 2015,SUM(Evol_Struc_Pop_2015[Pop 15-29 ans en 2015 (princ)]),
_slicer = 2021,SUM(Evol_Struct_Pop_2021[Pop 15-29 ans en 2021 (princ)])
)

vzhouwenmsft_3-1729749072059.png

 

 I can't upload your file to the forums because it's too big.

 

Best Regards,
Wenbin Zhou

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.