Forum Discussion
Two rules in one function and table
hi Anonymous
Not so sure about your expectation. Are you expecting 6 from the measure?
If so, try to create a measure like this:
ALL Issue Date - Actuals =
VAR _table1 =
ADDCOLUMNS(
SUMMARIZE(
CARTABLE,
CARTABLE[Name],
CARTABLE[Revision],
CARTABLE[Attribute]
),
"MaxDate",
CALCULATE(MAX(CARTABLE[Date]))
)
VAR _table2 =
FILTER(
_table1,
CARTABLE[Attribute] IN {"P01 Date Issued","P03 Date Issued","P02 Date Issued","Date Issued"}
)
RETURN COUNTROWS(_table2)
it worked like this:
- Anonymous3 years agoNot applicable
Thank you for the reply,
Sorry ignore revision column. The answer should be three. Trying to achieve a formula that takes the latest revision if it is filled in so P03 Date issued would be the latest for blue car. As there is no P03 Date issued for Red Car it counts the P02 as the latests, but if there is a P01 for the Red Car it ignores and does not count P01 Red Car and only counts the P02 from the attribute column. So, if the green car has a P01, P02, P03 it only counts the P03.
I hope this makes it more clear what trying to achieve. Thanks.
Red Car P02 Date Issued 13/11/2022 Blue Car P03 Date Issued 14/11/2022 Green Car Date Issued 11/11/2022 - FreemanZ3 years agoSuper User
hi Anonymous
that is necessary to know. Then try:
ALL Issue Date - Actuals = VAR _table1 = CALCULATETABLE( CARTABLE, CARTABLE[Attribute] IN {"P01 Date Issued","P03 Date Issued","P02 Date Issued","Date Issued"} ) VAR _table2 = ADDCOLUMNS( SUMMARIZE( _table1, CARTABLE[Name], CARTABLE[Revision] ), "MaxDate", CALCULATE(MAX(CARTABLE[Date])) ) RETURN COUNTROWS(_table2)