Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi there,
Its my first post, pls tell me when you need further Information.
Problem: there are two tables related by the dates table. Actual Cost is based on specific dates (e.g.: 01.05.2022; with duplicates), Expected Cost is based on Year Quarter (e.g.: 2022 Q2; no duplicates). I want to know the difference between expected and actual cost based on Year Quarter. Both tables are related to the Dates table (see picture).
i fooled around with sumx and related, but didn't really have any major breakthroughs. any idea how to solve this?
Thanks for helping
Solved! Go to Solution.
@Anonymous Maybe:
Measure =
VAR __YearQuarter = MAX('Dates'[Year Quartal])
VAR __Expected = MAXX(FILTER('Expected Cost',[Year Quarter] = __YearQuarter),[Prediction Sales])
VAR __Actuals = SUM('Actual Cost'[Total Value])
RETURN
__Expected - __Actuals
@Anonymous Maybe:
Measure =
VAR __YearQuarter = MAX('Dates'[Year Quartal])
VAR __Expected = MAXX(FILTER('Expected Cost',[Year Quarter] = __YearQuarter),[Prediction Sales])
VAR __Actuals = SUM('Actual Cost'[Total Value])
RETURN
__Expected - __Actuals
Awesome! Dose the Job i guess 🙂
However i coud observe something interesting, when totaling the measure (which i will not need):
- Everything looks fine, when selecting Q1 and Q2
- The total gets an negative value, when also selecting Q3. showing the Value of Q3 - (Q1 + Q2)
- When adding Q4 the total is positve again, but way to low.
I see there is a long way for me to understand dax. however your anser fixed my problem!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
95 | |
80 | |
67 | |
62 |
User | Count |
---|---|
146 | |
110 | |
107 | |
86 | |
63 |