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 September 15. Request your voucher.
Hi everyone,
I need to solve an issue that I am having with DAX, but I cant find the right query.
To give you some context: I have different regions in my data that have the values T100, T200, T300 and so on. They can be found in the column RegionLevel2 in the table Geography. Then , in the same table there is a column called TerrLevel1 that has the territories. Each region has multiple territories. So for example the territories for region T100, are T101, T102, T103 and so on. For each of these territories I have calculated a Score, based on their individual sales. It is a measure called Score1 and working fine. Now I need to calculate the score for the regions. This score is based on the average of the sales of a regions territories. So in the case of T100, its score would be the average of the Score1 of T101, T102, T103 and so on. I have tried these DAX
Solved! Go to Solution.
Hi @f_r_1998 ,
Based on your description, I created the following test data:
Create a measure
RegionScore =
CALCULATE(
AVERAGE(Geography[Sale]),
ALLEXCEPT(Geography,Geography[Region])
)
Final output
You can try the above test as I can't tell what your other filters are, and you can follow the above logic to write the code that works for you.
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @f_r_1998 ,
Based on your description, I created the following test data:
Create a measure
RegionScore =
CALCULATE(
AVERAGE(Geography[Sale]),
ALLEXCEPT(Geography,Geography[Region])
)
Final output
You can try the above test as I can't tell what your other filters are, and you can follow the above logic to write the code that works for you.
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
User | Count |
---|---|
65 | |
62 | |
59 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |