Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Dear Forum Community,
First time posting here. Hope you could help.
I have two fact tables as below:
.
Each "Staff" could be associated to one or *more* "Department" in every month. Each "Department" has one "Income" every month.
For each Staff, I need to get the "Total Income" and the "Average Income", across all the "Department" he/she associated to. Two values required: a) total and average across all the months, b) total and average in each month.
What is the DAX measure code to get these values?
Then, in my visual, I will plot graph/table showing the value for each month, using "Calendar[Month]" as my axis/row.
Kind regards,
Kar Ann
Solved! Go to Solution.
@chewkarann Maybe:
Measure Each Month =
VAR __StaffDept = DISTINCT('Fact Staff'[Department])
VAR __Table = FILTER('Fact Department', [Department] IN __StaffDept)
VAR __Total = SUMX(__Table, [Income])
VAR __Average = AVERAGEX(__Table, [Income])
VAR __Result = __Total // __Average
RETURN
__Result
Measure All Months =
VAR __StaffDept = DISTINCT('Fact Staff'[Department])
VAR __Table = FILTER(ALL('Fact Department'), [Department] IN __StaffDept)
VAR __Total = SUMX(__Table, [Income])
VAR __Average = AVERAGEX(__Table, [Income])
VAR __Result = __Total // __Average
RETURN
__Result
Hi @chewkarann,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi @chewkarann,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
@chewkarann Maybe:
Measure Each Month =
VAR __StaffDept = DISTINCT('Fact Staff'[Department])
VAR __Table = FILTER('Fact Department', [Department] IN __StaffDept)
VAR __Total = SUMX(__Table, [Income])
VAR __Average = AVERAGEX(__Table, [Income])
VAR __Result = __Total // __Average
RETURN
__Result
Measure All Months =
VAR __StaffDept = DISTINCT('Fact Staff'[Department])
VAR __Table = FILTER(ALL('Fact Department'), [Department] IN __StaffDept)
VAR __Total = SUMX(__Table, [Income])
VAR __Average = AVERAGEX(__Table, [Income])
VAR __Result = __Total // __Average
RETURN
__Result
User | Count |
---|---|
13 | |
8 | |
8 | |
7 | |
5 |
User | Count |
---|---|
21 | |
15 | |
15 | |
10 | |
7 |