So I have this code:
Everything works but the IF function.
The if function is suppose to check if the measure with the value "all" or the name of the current customer, and then apply that as a filter. For what ever reason [Current Customer] doesn't return the current customer, as if the IF is applying its own filter to the measure, messing up the data.
The formula for the current customer measure is:
Am I right in my conclusion? and if so, how do I make so it doesn't filter the measure when it tries to get data from it?
Code:
KPI 2016 = SUMX(
FILTER(
ALL('Data Warehouse'[Sale.Invoice Date],'Data Warehouse'[EXT AMOUNT],'Data Warehouse'[Customer.Customer Name]),
YEAR([Sale.Invoice Date]) = 2016 &&
MONTH([Sale.Invoice Date]) <= 'LTProd Data Warehouse'[Current Last Month] &&
MONTH([Sale.Invoice Date]) >= 'LTProd Data Warehouse'[Current First Month] &&
IF( EXACT([Current Customer],"ALL"),
TRUE(),
EXACT([Customer.Customer Name],[Current Customer])
)
),
[Profit])
Everything works but the IF function.
The if function is suppose to check if the measure with the value "all" or the name of the current customer, and then apply that as a filter. For what ever reason [Current Customer] doesn't return the current customer, as if the IF is applying its own filter to the measure, messing up the data.
The formula for the current customer measure is:
Code:
Current Customer = IF(HASONEVALUE('Data Warehouse'[Customer.Customer Name]),
LASTNONBLANK('Data Warehouse'[Customer.Customer Name],TRUE()),
"ALL")
Am I right in my conclusion? and if so, how do I make so it doesn't filter the measure when it tries to get data from it?