Forum Discussion
petroswheels
6 years agoNew Member
Joining data for measures
Hi All - I'm a beginning user, so please forgive this rookie question. I have two sets of data, that I'd like to connect to get a percentage of the regional goal that was met for a given period....
Greg_Deckler
Community Champion
6 years agopetroswheels - First thing I would do is unpivot your "state" columns in Table 2. I would then create a bridge table between your two tables using this:
State Table = DISTINCT('Table1'[State])
Create the relationships between the tables and you might need them to be bi-directional. Then create a measure like the following:
Measure =
VAR __State = MAX('States Table'[State])
VAR __Month = MAX('Table 2'[Date])
VAR __Count =
COUNTROWS(
FILTER(ALL('Table 1'),[State] = __State && MONTH([Date of Order]) = MONTH(__Month) && YEAR([Date of Order]) = YEAR(__Month)
)
)
VAR __Goal = MAX('Table 2'[Value])
RETURN
[__Count] / __Goal
Something along those lines.