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.
Hi
I am wanting to add a measure that will sum or calculate the total 'Budget' amount for each 'Code' which is shown in the pivot or matrix. The results are using a filter context based on the two measures* I added to the matrix; e.g. "TOTAL A 5K+", which look as values equal to or above 5k.
My table, or PowerPivot/Matrix.
CODE | Budget | *TOTAL A 5K+ | *TOTAL ORDERS 5K+ |
QE660759 | 5,910.00 | ||
QE6666311 | 9,575.32 | ||
QE6666516 | 8,690.55 | ||
QE665617 | 7,395.53 | ||
QE666310 | 6,070.22 | ||
QE77737 | 8,746.00 | ||
QE77798 | 7,919.40 | 5,767.39 | |
QE839660 | 7,666.00 | ||
QE-3596 | 5,266.60 | ||
QE-396666 | 5,932.60 | ||
QE-666661 | 9,000.00 | ||
QE-666697 | 5,944.00 | ||
QE-66565 | 7,570.00 | 5,770.00 | |
QE-66675 | 5,288.00 | ||
QE-66870 | 6,304.40 | ||
QEB0563 | 6,900.00 | ||
QEB0637 | 5,596.58 | ||
QEE8182 | 5,533.50 | ||
QEE8363 | 6,848.00 | 5,844.00 | |
QE1110 | 9,053.66 | ||
QE80660 | 9,757.00 |
My measure example - *TOTAL A 5K+:=CALCULATE(SUM([FieldName]), TableName[FieldName]>=5000)
There are over 1k codes, I am just using the 2 measures above to identify any areas that are 5k value but I want to show the correpodaning 'Budget' amount to that correspoding 'Code'; each code has its own budget to spend. When I add a SUM()or CALCULATE() FUNCTION I still get all the codes in the table. Suppose I am just highlighting the Top n codes that are more than 5k, but I would like to know how you woudl go about thi susing DAX?
Many thanks
Chris
Solved! Go to Solution.
@Anonymous , Try like
sumx(filter(summarize(Table,Table[CODE],"_1",SUM([FieldName])),[_1]>5000),[_1])
Amitchandak
Thats for the reply, however the formula is not working however I feel this is maybe due to my data model. For example the code element works off a related table. I have alos noticed a flaw in my design, trying to create two measures to flag values from opposite spectrums could add confusion to the results. It was useful though to see your solution, which adds to my knowledge and use and apply theses functions. Again many thanks for your help.
User | Count |
---|---|
12 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
13 | |
9 | |
7 |