Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
Hello!
I want the used the total of a measure as a constant for another measure, but have yet been unable to do this. Here's what I have:
I currently calculate GAP and (% ALL GRAD) - (% GRAD). However, what I want is to calculate GAP = (Total % WgtAVG; 4.39%) - % GRAD.
The masure for % WgtAVG =
VAR __CATEGORY_VALUES = VALUES('Equity Grads'[REPORTING_RACE_ETHNICITY])
RETURN
DIVIDE(
SUMX(
KEEPFILTERS(__CATEGORY_VALUES),
CALCULATE([% GRAD] * SUM('Equity Grads'[STUDENTS]))
),
SUMX(
KEEPFILTERS(__CATEGORY_VALUES),
CALCULATE(SUM('Equity Grads'[STUDENTS]))
)
)
I have tried various SUMX's on this measure to no avail and used the totals under Quick Measure as well, but not luck.
Any help would be appreciated.
- - - Andrew
Solved! Go to Solution.
Sam,
Thanks for the idea. Unfortunately, I was unable to figure out how to apply that to get what I want, but did solve my problem another way.
I calculated the weigted average using:
% WgtAVG =
VAR __CATEGORY_VALUES = VALUES('Equity Grads'[REPORTING_RACE_ETHNICITY])
RETURN
Sumx(KEEPFILTERS(__CATEGORY_VALUES),
Calculate(sum('Equity Grads'[STUDENTS])*SUM('Equity Grads'[GRAD])/CALCULATE(sum('Equity Grads'[STUDENTS]),ALL('Equity Grads'[GRAD_TRACKING_TERM],'Equity Grads'[REPORTING_RACE_ETHNICITY],'Equity Grads'[STUDENT_OF_COLOR]))/CALCULATE(sum('Equity Grads'[STUDENTS]),ALL('Equity Grads'[GRAD_TRACKING_TERM],'Equity Grads'[REPORTING_RACE_ETHNICITY],'Equity Grads'[STUDENT_OF_COLOR]))))
Then, I summed the % WgtAVG using:
% Total WgtAVG = sumx(all('Equity Grads'[REPORTING_RACE_ETHNICITY],'Equity Grads'[STUDENT_OF_COLOR]),'Equity Grads'[% WgtAVG])
I am still working through the logic of why these work, but they work under all the circumstances I need them.
- - - Andrew
You may try the ALLSELECTED Function.
http://community.powerbi.com/t5/Desktop/Percentages-to-multi-line-report/m-p/378504#M172040
Sam,
Thanks for the idea. Unfortunately, I was unable to figure out how to apply that to get what I want, but did solve my problem another way.
I calculated the weigted average using:
% WgtAVG =
VAR __CATEGORY_VALUES = VALUES('Equity Grads'[REPORTING_RACE_ETHNICITY])
RETURN
Sumx(KEEPFILTERS(__CATEGORY_VALUES),
Calculate(sum('Equity Grads'[STUDENTS])*SUM('Equity Grads'[GRAD])/CALCULATE(sum('Equity Grads'[STUDENTS]),ALL('Equity Grads'[GRAD_TRACKING_TERM],'Equity Grads'[REPORTING_RACE_ETHNICITY],'Equity Grads'[STUDENT_OF_COLOR]))/CALCULATE(sum('Equity Grads'[STUDENTS]),ALL('Equity Grads'[GRAD_TRACKING_TERM],'Equity Grads'[REPORTING_RACE_ETHNICITY],'Equity Grads'[STUDENT_OF_COLOR]))))
Then, I summed the % WgtAVG using:
% Total WgtAVG = sumx(all('Equity Grads'[REPORTING_RACE_ETHNICITY],'Equity Grads'[STUDENT_OF_COLOR]),'Equity Grads'[% WgtAVG])
I am still working through the logic of why these work, but they work under all the circumstances I need them.
- - - Andrew
Check out the May 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
79 | |
72 | |
71 | |
54 | |
51 |
User | Count |
---|---|
45 | |
38 | |
33 | |
31 | |
28 |