Forum Discussion

waldnerr's avatar
waldnerr
Icon for Helper I rankHelper I
6 years ago

Count initial planned date per month

Hi,

i have created a measure, which counts the planned final acceptance dates (qg13date) per month based on the selected evaluation period (31.03.2020) accumulated and ascending:

 

Sample data from "Project Period" table:

Measure:

 

Qg13Date Planned/Actual (Count per YYYY.MM) =
CALCULATE (
COUNT ( 'Project Period'[QG13Date (YYYY.MM)] ),
FILTER (
FILTER (
ALLSELECTED ( 'Project Period'[QG13Date (YYYY.MM)] ),
ISONORAFTER (
'Project Period'[QG13Date (YYYY.MM)], MAX ( 'Project Period'[QG13Date (YYYY.MM)] ), DESC
)
),
FORMAT ( MAX ( 'Project Period'[qg13Date] ), "YYYY" )
= FORMAT ( MAX ( 'Project Period'[DateKey] ), "YYYY" )
)
)

 

Result:

Until this point, everything works as expected.

 

In addition, i want to add an additional column, where the the planned final acceptance based on the data from the first evaluation period of this year (31.01.2020) is counted in the same fashion as shown above.

 

Sample data + desired result:

 

I have tried to rewrite the DAX code mentioned above to recieve the desired result (added all, firstdate etc. ...) but always ended up with exactly the same result shown in the column "Qg13Date Planned/Actual (Count per YYYY.MM)".

 

It would help me a lot i you could give me a hint / show me a solution, how the measure shown above needs to be altered to recieve the desired result.

 

Thank you,

Best regards,

Reinhard

 

2 Replies