The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Market | Age Group | Population |
Country A | 00-04 | 1 |
Country A | 05-09 | 2 |
Country A | 10-14 | 3 |
Country B | 00-04 | 4 |
Country B | 05-09 | 5 |
Country B | 10-14 | 6 |
Country C | 00-04 | 7 |
Country C | 05-09 | 8 |
Country C | 10-14 | 9 |
Solved! Go to Solution.
Hi @AC1223,
Based on my test, the formula below should work in your scenario.
Measure = MEDIANX ( SUMMARIZE ( Table1, Table1[Market], "Total Population", SUM ( Table1[Population] ) ), [Total Population] )
Just replace Table1 with your real table name.
Regards
I created this measure below ( my table is called DataSelect):
Measure = DIVIDE ( SUM ( DataSelect[Population] ), DISTINCTCOUNT ( DataSelect[Market] ), BLANK () )
You have the output below, please let us know if it is not your expected results.
Ninter.
Hi Interkoubess,
Thankyou for your response.
The results are right in this case, but this is not calculating the median.
It does not work with other numbers.
eg, if I change the dataset to below:
Market | Age Group | Population |
Country A | 00-04 | 1 |
Country A | 05-09 | 100 |
Country A | 10-14 | 7 |
Country B | 00-04 | 80 |
Country B | 05-09 | 5 |
Country B | 10-14 | 2000 |
Country C | 00-04 | 30 |
Country C | 05-09 | 2 |
Country C | 10-14 | 50 |
Hi @AC1223,
Based on my test, the formula below should work in your scenario.
Measure = MEDIANX ( SUMMARIZE ( Table1, Table1[Market], "Total Population", SUM ( Table1[Population] ) ), [Total Population] )
Just replace Table1 with your real table name.
Regards
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
101 | |
82 | |
62 | |
55 |
User | Count |
---|---|
252 | |
119 | |
115 | |
95 | |
70 |