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
MarcoPazBI
New Member

Data Model Issue ? Measure is being repeated once I add a column that is not linked to my Fact Table

I got a data model with two Fact Tables, and both are grouped differently:

fExpenditures is grouped by columns [CIP], [Phase], [Award] and [Supplier]
fPhase Status is grouped by column [CIP] and [Phase] only (the Award and Supplier do not matter for when a Phase for a Project is going to start and finish).

 

I am trying to build a table like this:

 

MarcoPazBI_0-1680293320628.png

 

As you can see, I have 3 lines for Design and 4 for Construction due phases having multiple Awards. My Phase Start and Phase Finish are acting accordingly on the example above.

 

When I try to replicate this in Power BI, I get a table with all Awards my data model got instead of only these 7 lines:

 

MarcoPazBI_1-1680293491895.png

 

This is how my data model looks:

 

MarcoPazBI_2-1680293540346.png

 

And this is the measure I created:

 

TEST Phase Start = 
VAR CurrentCIP = SELECTEDVALUE(dCIP[CIPKey])
VAR CurrentPhase = SELECTEDVALUE(dPhase[PhaseKey])
RETURN
CALCULATE(
    MIN('fPhase Dates'[Start]),
    'fPhase Dates'[CIPKey] = CurrentCIP,
    'fPhase Dates'[PhaseKey] = CurrentPhase
)

 

 

Any idea why this is ocurring and what would be the best way to fix it ?

 

Thanks

 

3 REPLIES 3
olgad
Super User
Super User

I would remove dPhase -expenditures and dcip-expenditures, connect dcip to phase dates and phase dates to expenditures. 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

If I do that, I will lose the ability to get my "Total Spent" from Expenditures, since there will be one connection between dPhase and dCIP to the Expenditure table, right ?

Can you ping me your report in private message  i will take a look how to connect them, may be it is easier like that


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

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.