Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |