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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
FaisalImam
Helper I
Helper I

Model Relationship

Hi All,

 

Basically I am unable to create relation between two tables.There is one table with Static data :Type,key service level(consider as formula names). Another table with raw data but both these table have nothing in common.Now we need to calculate some measures and store it in respective  keyservicxe level.

 

When I try to store it in respective row, because I dnt have relation,all row gets filled by the same value.

 

Model table :

 

KeyService levelMarch month
A1resolution -a156
B3resolutioncritical-a275

 

 

Can we compare the row values(a1,a2) with the measures name ? In that way we can store it in specific rows as required.

1 ACCEPTED SOLUTION

SWITCH is a function used in measures /calculated columns wich is essentially  nested IFs executed in order. So the measure in this case is checking the filter context (established by SELECTEDVALUE) and returning the corresponding measure. So the first statement checks whether the conext is "A1" and if true returns the measure [M1] and so on...Make sense?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

7 REPLIES 7
PaulDBrown
Community Champion
Community Champion

Try

TheMeasures = 

SWITCH(SELECTEDVALUE (Table1[Key Service]),
"A1", [M1],
"A1.1", [M6],
"A2", [M2])





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi PaulDBrown,

 

Thanks , this actually somewhat worked. Can you please explain what the  qwuery is actually doing  as that would be helpful for me to learn.

SWITCH is a function used in measures /calculated columns wich is essentially  nested IFs executed in order. So the measure in this case is checking the filter context (established by SELECTEDVALUE) and returning the corresponding measure. So the first statement checks whether the conext is "A1" and if true returns the measure [M1] and so on...Make sense?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Can you explain brief please ? I am a begginer.

Do you mean to create a new column using the above switch statement ? if so in which table ? The one having static data or the one where we have calculated the measures.

You need to create a new measure with the code. Then create a new table visual, add the fields from Table 1 and add the measure





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

@FaisalImam , Not very clear

 

measure like

a1 = calculate(sum(Table[March Month]) , Filter(all(Table[Level]) Table[level] ="a1") )

 

 

a2 = calculate(sum(Table[March Month]) , Filter(all(Table[Level]) Table[level] ="a2") )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

No Actually you did not get my point.

 

The table , I have shown is how it will be coming on the dashboard.

Column1- Key Service Level  ( has all static values in table1 )

Column 2 - Month( has values calculated from another table - table 2  in which everymonth data will be refreshed) 

 

My problem : I am unable to put the values that I have calculated in the right row because we don't have any relation..

Example  :

Table 1

Key Service Expected
A195%
A1.165%
A290%

 

Table 2 :

inctime period
sghdf74
srwetbnjl91
sdgyfumbm42

 

Now from table 2 ,I have calculated several measures  let it be M1,M2,M6

 

Now how it needs to be viewd on dashboard:

 

key service levelexpectedMeasures
A195%M1
A1.165%M6
A290%M2

 

What logic to use top have such relation. We don't have any relation between measures and the key service level.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors