Forum Discussion
Creating a measure using multiple tables
16 Replies
- AnonymousNot applicable
Hi cass_butchard ,
Try the following measure
It is assumed that there is a relationship between Defects and Date table.Oustnding DefectsEOM = CALCULATE(SUM(Defects[Estimatedquantity]),FILTER( Defects,Defects[CompletionDate(ShortDate)] > 'Date'[MonthEnd] || Defects[CompletionDate(ShortDate)] = BLANK()))Let me know if it worked.CheersCheenuSing- cass_butchardFrequent Visitor
Hi There,
I have tried the above solution however even though there is a relationship between the date table and defect table I am unable to use a field from the date table in the filter statement without the generate statement connecting the two tables together. Screen shots below:
- AnonymousNot applicable
- cass_butchardFrequent Visitor
Hi CheenuSing - The X Axis populated from the date raised field in defects however I just attempted to use a date field from the Date table on the X axis and this still did not allow me to populate this field
- AnonymousNot applicable
Hi cass_butchard ,
Can you please share some more detail information about this scenario? They should help us clarify your scenario and test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
- AnonymousNot applicable
Hi cass_butchard ,
When typing the DATE([MonthEnd]), try typeing 'Date'[MonthEnd] instaead of DATE[MonthEnd].
Reason being DATE when typed is a function. WHen Typed 'DATE' it will refer to the date table.
Alternatively change the table name Date to DimDate and try.Cheers
CheenuSing
- cass_butchardFrequent Visitor
Hi Anonymous - MonthEnd is a field within my own date table that I am attempting to use to calculate in order to sum at a moment in time being the last day of the month - so if the completion date is after that month has finished then it would have been outstanding for that particular month and also count fields that were BLANK for that month also.
I tried both of your options but I need the generate statement to link both the Defects Table and the Date table together. I am also using date raised in the X axis. My current measure is:
OutstandingDefectsEOM = CALCULATE(SUM(Defects[Estimatedquantity]),FILTER(GENERATE(Defects, 'Date'),OR(Defects[CompletionDate(ShortDate)] > 'Date'[MonthEnd], Defects[CompletionDate(ShortDate)] = BLANK())))which is returning a value of 613 however based on records in the system it should be 1006.- AnonymousNot applicable
Hi cass_butchard ,
Can you please share the pbix or the data of defects and date in onedrive and share the link.
Can you paste the data model from the model view.
Cheers
CheenuSing
- AnonymousNot applicable
Hi cass_butchard ,
Any update on this? Can you please share some more detail information about this?
results?
Regards,
Xiaoxin Sheng