Hello, I have calculated measure Total_LC as given below Total_LC = VAR F12 = SUM('NCC Chart''s'[F12]) VAR H12 = SUM('NCC Chart''s'[H12]) RETURN (average('NCC Chart''s'[Net_NCC_Cost])+ ...
Dear all, sorry to enter your discussion but it is really a KEY point for my project and I am trying to solve it since many days with no success.
My situation is exactely the same, looking at the results, but different about the origin of the data.
Please try to help me!!!!! (Let me know if I should write a new post....)
I think I understood the solutions offered using SUMX, but it seems referred to data that are in a table.
I.E. if I have I table like the following one:
DATE value1 value2
01 jan 18 10 15
02 jan 18 5 1
03 jan 18 7 2
In this case, if I should choose between "value1" and "value2" under certain conditions, it seems possible to use SUMX with an IF statement ore HASONEVALUE and so on. (Reading aroung on theweb it seems to be the most used solution)
But MY situation is that I have 2tables (from a database) from which to take the information, and managed through measures.
Like followings:
FORECAST:
DEFINITE:
So the values I have to show are not originated from values from one table, but they are measures originated from 2 tables . (Actually it is a simplification... in reality they are measures coming from other measures filtered by other elements...but all of them from 2 original tables)
They are:
OTB FORECAST = SUM(FORECAST[ITEMS])
OTB DEFINITE = SUM(DEFINTE[ITEMS])
My needed results are also depending to a "reading date":
for a certain date ( i.e. 2nd jan) if the reading date is later than the date we are looking at, then show "DEFINITE", otherwise show "FORECAST":
ACTUAL = IF([maxreadingdate]<=[maxdate];[OTB FORECAST];[OTB DEFINITE])
You can see from the image below it is ok, except than for the month total that, for ACTUAL, should be 673. The presence of the "maxdate" and "mareadingdate" on the "month total" row demonstrate the way PowerBI manage this situation:
on the "month total" row the IF statement is satisfied, therefore it makes the calculation on the "OTB FORECAST" values.
About SUMX: I have seen that SUMX applies to TABLES. But as said my [OTB FORECAST] and [OTB DEFINITE] are not in a table... they are measures...
It seems I cannot use it!
Also the "HASONEVALUE" cannot be applied...
AAARRRGHHH !!!!! I REALLY REALLY NEED HELP!!! Feeling really frustrated.