Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
This is my measure. I want to be able to filter on the Date dimension. Next I want to get back the latest date before the MAX date of the filted date dimension. This date is used to find the factprognosisLine values I want. This needs to be calculated for every line in the Job dimension. After that I want to sum the values. I use SUMX for this. unfortunately this is not working as I want. The value I get is to high. It seems to be a bug, but mayby I'm making a mistake.
Can someone help me?
This is my measure
# Prognose opbrengsten OP =
VAR max_date = MAX('Date'[Date])
VAR _dateID =
CALCULATE(
MAX(factPrognosisLine[PrognosisDateID]),
FILTER(
Prognosis,
Prognosis[PrognosisFrozen] = "true" &&
Prognosis[PrognosisDate] <= MAX('Date'[Date])
),
ALL('Date')
)
RETURN
SUMX(
VALUES(Job),
CALCULATE(
SUM ( 'factPrognosis'[PrognosisTotalRevenuesRoughAmount_RCY] ),
FILTER(ALL(factPrognosisLine), factPrognosisLine[PrognosisDateID] = _dateID),
ALL('Date'),
FILTER(
Job,
Job[PostingDateClosing] > max_date ||
Job[PostingDateClosing] < DATE(1900, 1, 2)
)
)
)
This is an example. This is the full table.
This are the relationships
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.