Forum Discussion
Results for multiple categories
Hi All,
I have a category column in my table that is Either ETL or Manual, that represents wether a row comes directly from the ETL process or through a manual upload. Each row will have a corresponding value, split by KPI Type category column as shown in the attached.
The problem I'm having is that if for a given month and KPI Type there is an row in the category column for ETL I want to see only that, if there is a row for both ETL and Manual, then only return ETL but if there is only a row for Manual then return that.
My current measure is this, however it isn't returning the manual rows.
Use this updated measure to prioritize ETL rows and return Manual rows only if ETL is absent:
Combined Value = VAR HasETL = CALCULATE(SUM(F_WIND_KPI_MONTHLY[VALUE]), F_WIND_KPI_MONTHLY[Manual Flag] = "ETL") VAR HasManual = CALCULATE(SUM(F_WIND_KPI_MONTHLY[VALUE]), F_WIND_KPI_MONTHLY[Manual Flag] = "M") RETURN IF(HasETL > 0, HasETL, HasManual)This ensures ETL rows take precedence, and Manual rows are included only when ETL is absent.
1 Reply
- rohit1991
Super User
Use this updated measure to prioritize ETL rows and return Manual rows only if ETL is absent:
Combined Value = VAR HasETL = CALCULATE(SUM(F_WIND_KPI_MONTHLY[VALUE]), F_WIND_KPI_MONTHLY[Manual Flag] = "ETL") VAR HasManual = CALCULATE(SUM(F_WIND_KPI_MONTHLY[VALUE]), F_WIND_KPI_MONTHLY[Manual Flag] = "M") RETURN IF(HasETL > 0, HasETL, HasManual)This ensures ETL rows take precedence, and Manual rows are included only when ETL is absent.