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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Use values from external tables for filtering table dynamically

I have several tables that filter a fact table (not linked by any variable in the data model).
The columns which contain the values are chosen dynamically by a measure. 

 

Minimal example with three tables:

 

 

Table FOOD

F_1F_2F_3
FoodFruitsApples
FoodFruitsOranges
FoodMeatChicken


Table COUNTRY

 

C_1C_2C_3C_4
WORLDEUROPEFRANCEPARIS
WORLDEUROPEITALYROME
WORLDEUROPEITALYVENICE
WORLDAMERICAMEXICOMEXICO

 

Table FACT

 

FOODSTUFFGEOGRAPHYVALUE
FoodPARIS1
FoodROME2
FoodVENICE3
FoodMEXICO4
FoodFRANCE5
FoodITALY6
FoodMEXICO7
FoodEUROPE8
FoodAMERICA9
FoodWORLD10
FruitsMEXICO11
FruitsFRANCE12
FruitsITALY13
FruitsMEXICO14
FruitsEUROPE15
FruitsAMERICA16
FruitsWORLD17
ApplesMEXICO18
OrangesEUROPE19
ChickenAMERICA20
MeatWORLD21

 

Measure FCol tells me at what F_ should I look and CCol at what C_ .
My aim would be to

CALCULATE(SUM(FACT[VALUE]),FILTER(FACT,FACT[FOODSTAFF] in VALUES( Something here to obtain F_ based in FCol),FILTER(FACT,FACT[GEOGRAPHY] in VALUES( Something here to obtain C_ based in CCol)

 

I tried to include the values in a VAR but that didn't work.

How can I combine the filters together?

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @Anonymous ,

 

I'm not very clear about what you were trying to achieve based on current description. Please show us the desired output with examples. What visual did you use? How to apply drill down? How to apply filters and which column should be added to slicer?

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MFelix
Super User
Super User

Hi @Anonymous,

 

What is the purpose of having in the fact table a mix between the columns of the Fruit and of the Country?

 

Having the filter tables setup with and hierarchy model and then having any of the columns on your fact table will not get you the correct results since you won't be abble to pinpoint wich table you are refering to.

 

What is the purpose of your selection is to have the selection of Apples and then get only apples or do you also want to get the higher level in the table FOOD so Fruits and Food?

 

Or do you want to select FOOD or FRUITS or APPLES and get only the values for that specific selection?

 

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hello MFelix,

In the real case I have a third hierarchy that I use for drilling up and down. I embed the hierarchy logic of the visuals using in scope and in order to define the hierarchycal filters the easiest way to go I thought of is allowing a moving filter dependant on the maximal hierarchy level that can be displayed (Those higher levels usually have more inforamtion available in other dimensions).

 

To your question I'll never sum two different levels in a chart (I either sum apples and oranges or fruits). However, all combinations of (F_x , C_x) are possible.

 

Kind regards,

Jon

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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