Dear DAX community,
Will you please help me with the DAX calculation?
I have a DAX measure for average monthly headcount for:
- actual months, based on certain selection, e.g. ledger K, Account Code, Journal Type, etc
- forecast months, based on differnt selection criteria, e.g. ledger F, Account Code, Journal Type, Budget Marker, etc
I cannot figure out how to set up DAX so that it calculates average annual headcount based on the two sets of numbers:
At the moment I created a very long DAX code, partly because I would like it to be very dynamic, i.e. a user can select a forecast version (Journal Use on screen). For the same reason of dynamic selection I cannot make it a calculate column.... I think...
However, the average (total line) for the year is still a sum of the two measures. It should be annual average 602.39 rather than a sum shown now as 1199.24
Any suggestions??
Many thanks,
Solved! Go to Solution.
Hello
I would like to let you know - just in case you will come with the same issue/task - the only way I could get the calculation in DAX for AVERAGEX for a mix of actual and forecast data was through Power Query. I marked rows for each forecast version, ie. 2+10 would have all actual from Ledger A for period 1 and 2 and 10 months from Ledger F for period 3 to 12, etc. Via list functions. Then from the row context it was easy to calculate AVERAGE of mixed data.
Kind regards
Mira
Hello
I would like to let you know - just in case you will come with the same issue/task - the only way I could get the calculation in DAX for AVERAGEX for a mix of actual and forecast data was through Power Query. I marked rows for each forecast version, ie. 2+10 would have all actual from Ledger A for period 1 and 2 and 10 months from Ledger F for period 3 to 12, etc. Via list functions. Then from the row context it was easy to calculate AVERAGE of mixed data.
Kind regards
Mira
Hi, @mira_abel
Can you share some sample data and your calculation logic and your desired result? Your description is not specific, it is difficult for us to imagine and modify.
Reference the steps:
How to Get Your Question Answered Quickly - Microsoft Power BI Community
Best Regards
Janey Guo
User | Count |
---|---|
116 | |
62 | |
60 | |
47 | |
40 |
User | Count |
---|---|
111 | |
63 | |
62 | |
51 | |
48 |