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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Raj12
Helper III
Helper III

Measure to return value from a connected table based on another table selection

Table 1 (LFSLTRNR) has monthly sales for an agent

Table 2 (Agents Target) has monhtly target for an agent.

Table 1 and 2 are connected via agent code

 

Report has Sale date filter from table1 and measure showing agent target for that slected month.

If there is no sale for an agent in a month then their target is coming as blank in the measure, but I want to show target even if there is no sale data in table 1 for an agent i.e. ignoring connection between two table when there is no sale.

 

Measure=

var yrs = SELECTEDVALUE(LFSLTRNR[STRNDT_YEAR])
var mon_start_date =     CALCULATE(Min(LFSLTRNR[STRNDT_Month] ),ALLSELECTED( LFSLTRNR[STRNDT_Month] ))
var mon_end_date =     CALCULATE(Max( LFSLTRNR[STRNDT_Month] ),ALLSELECTED(LFSLTRNR[STRNDT_Month] ))
var agent = SELECTEDVALUE('Team Details (Prop track)'[Sales Code])
return
CALCULATE(SUM('Agents Target'[Value]),
'Agents Target'[Sales Code]=agent,
'Agents Target'[Month]>=mon_start_date && 'Agents Target'[Month]<=mon_end_date && 'Agents Target'[Year]=yrs)
 
7 REPLIES 7
lbendlin
Super User
Super User

That would be a question for your data model. How does that look like?

Hi Ibendlin,
Please find below data model:

Raj12_0-1718616918873.png

Agent Code & Sales Code of two table are connected together.
Now if we select STRNDT Feb 2024, there is no sale for Agent PAG but there is target for him, hence want measure to show target even if there is no sale for an individual.
Please suggest on the same. Thank you

 

Is that bidirectional *:* ?

yes its bi-directional

that's the worst case scenario.  Correct it if possible or use CROSSJOIN(..,NONE) to temporarily disable the relationship.

Can you please suggest on this?

yes can change to below:

Raj12_0-1718699770350.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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