Forum Discussion
Complicated Count Measure based on other measures
villa1980 Ensure that your [METRIC] table is related to the [Calendar] and [CSD] tables. If direct relationships are not possible due to the complexity of your measures, consider using a bridge table or creating calculated columns that can help establish these relationships.
Combine the logic of your measures into a single measure:
FINAL =
VAR ContribCheck = [Contrib] > 0
VAR BAU = IF(ContribCheck, "BAU", "Other")
VAR Operational = SWITCH(TRUE(), BAU = "Other" && [Score_1] < 5, "Other", BAU = "Other" && [Score_1] >= 5, "Operational", "BAU")
VAR Headcount = SWITCH(TRUE(), Operational = "Other" && OR([Less_Than_3_Heads] = "TRUE", [GPPH_Accept] = "TRUE"), "Headcount", Operational)
VAR Footfall = IF(Headcount = "Other", "Footfall", Headcount)
RETURN IF(Footfall = "Other", "Footfall 2", Footfall)
Create a summary table to count the "Buckets" by monthyear and Centre Name:
DAX
SummaryTable =
SUMMARIZE(
ADDCOLUMNS(
[METRIC],
"MonthYear", RELATED([Calendar][MonthYear]),
"CentreName", RELATED([CSD][CentreName]),
"FinalBucket", [FINAL]
),
[MonthYear],
Step 3: Visualize the Data
Use the SummaryTable to create your visualizations in Power BI. You can create a matrix or table visual to display the counts of each "Bucket" by monthyear and Centre Name.
Wow that is amazing, you have made it sound so much simplier than what I was looking at, thanking you so much.
I am not sure I am able to create a direct relationship between the tables, how would I create a bridging table or calculated columns?