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.
Hello,
I have below table. I created average days and total sales measures.
Category | Days | Sales |
AB | 35 | 2345 |
AF | 89 | 265 |
AG | 24 | 50 |
AF | 80 | 2376 |
AG | 34 | 4596 |
Now I want to divide each category by the total like sales total is 9632 so I want to divide each category sales like category AF has total sales of 169 divided by 9632. Same goes with other as well. Similarly I want to divide average days with average days measure total of 52.4 for each category.Kindly help. I am new to it.
Thank you
Solved! Go to Solution.
Hi @syedjunaid11 , if I have understood you correctly, you have to create this 2 measures:
Avg_days-Avg_total = var avg_total= CALCULATE(AVERAGE('Table'[Days]),ALL('Table'))
return
divide(CALCULATE(AVERAGE('Table'[Days]),ALLEXCEPT('Table','Table'[Categoy])),
avg_total,"-")
Sum_days-Total_sales = var sales_total= CALCULATE(sum('Table'[Sales]),ALL('Table'))
return
divide(CALCULATE(sum('Table'[Days]),ALLEXCEPT('Table','Table'[Categoy])),
sales_total,"-")
The result
Best Regards
Hi,
If Days and Sales are measures, then how can Category entries repeat in your visual?
Hi @syedjunaid11 , if I have understood you correctly, you have to create this 2 measures:
Avg_days-Avg_total = var avg_total= CALCULATE(AVERAGE('Table'[Days]),ALL('Table'))
return
divide(CALCULATE(AVERAGE('Table'[Days]),ALLEXCEPT('Table','Table'[Categoy])),
avg_total,"-")
Sum_days-Total_sales = var sales_total= CALCULATE(sum('Table'[Sales]),ALL('Table'))
return
divide(CALCULATE(sum('Table'[Days]),ALLEXCEPT('Table','Table'[Categoy])),
sales_total,"-")
The result
Best Regards
User | Count |
---|---|
78 | |
74 | |
43 | |
32 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
50 | |
46 |