The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have created a measure which calculates Employee requirement and the calcualtion is paid time/ working days. This works as expected in periodic manner for state level. But, my requirement is to add up the obtained values of each state to calculate the country level employee requirement.
Ex - Region A = paid time of region A/ Working days of region A
Region B = paid time of region B/ Working days of region B
Country = Sum(Region A + Region B).
The new DAX is required for country level.
Solved! Go to Solution.
Following to our virtual meeting, following is the workable code.
FTEsConso =
SUMX (
CROSSJOIN ( VALUES ( table[Att] ), VALUES ( 'table1'[region] ) ),
CALCULATE (
DIVIDE ( CALCULATE ( [TotalValue], 'table'[Att] = "paid_time" ), [WD], 0 )
)
)
Following to our virtual meeting, following is the workable code.
FTEsConso =
SUMX (
CROSSJOIN ( VALUES ( table[Att] ), VALUES ( 'table1'[region] ) ),
CALCULATE (
DIVIDE ( CALCULATE ( [TotalValue], 'table'[Att] = "paid_time" ), [WD], 0 )
)
)
Thanks a lot for your help Tamer, it worked as expected!
Hi @nareshr89,
Did @nareshr89 's suggestions help with your scenario? if that is the case, you can consider Kudo or Accept his suggestions to help others who faced similar requirements.
If that also doesn't help, can you please share a pbix or some dummy data that keep raw data structure with expected results? They will help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi @nareshr89
This should return the desired result at both levels
EX =
SUMX (
VALUES ( Employee[Region] ),
CALCULATE (
DIVIDE ( SUM ( Employee[Paid Time] ), SUM ( Employee[Working Hours] ) )
)
)
What needs to be used in the Employee[Region], currently i have a region column based on which the results are not coming.
I'm sorry. Would you please clarify your reply further? Did you try the suggested code? What outcome do you get when you try it?
I tried the suggested code, but was not able to get the desired result also i was not clear on what needs to be used in the place of Employee [Region]
Can you please share the code that you've used and a screenshot of the results
Expected Result is around 1206
Try to put the code of "paidTime" directly inside "DIVIDE" rather tgsn using the variable
If i store the evaluated employee requirement result in a column, then at a quarterly level it doesn't pickup the right values. Almost the value doubles.
User | Count |
---|---|
12 | |
9 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
14 | |
9 | |
7 |