Forum Discussion
Need help regarding DAX
- Anonymous1 year ago
Hi Emranit ,
Thank you for reaching out to the Microsoft Fabric Community Forum about the issue you are encountering.
Based on my understanding, the following DAX measure might help you address the query:
Dyelot Per Machine = VAR TotalDyelot = 11
DIVIDE(TotalDyelot, SELECTEDVALUE('Machines'[Machine Count]), BLANK())
To get the divided result on top of the bar of each value machine, select a clustered column chart :- Use Machine Weight (kg) as the X-axis
- Use Machine Count as the Y-axis
Display the Dyelot per Machine (new measure) as data labels on top of each bar. To enable data labels:
- Click on the chart ,select Format then turn on Data Labels
- Set labels to show Dyelot Per Machine value
Refer the attached file for more clarification.
If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more quickly. - Anonymous1 year ago
Hi Emranit ,
Thanks for your follow-up! Based on your request, you may use the following DAX formula to calculate the average number of machines by dividing the total selected machines by the unique machine count:
new Average_Machines =VAR TotalMachines = COUNTROWS(ALLSELECTED('Machine'))VAR UniqueMachines = CALCULATE(DISTINCTCOUNT('Machine'[Machine Info]), ALLSELECTED('Machine'))
RETURNDIVIDE(TotalMachines, UniqueMachines, 0)
For better understanding, I have created a new measure to get the average value.Please refer the below screenshot for clear understanding.You can either modify your existing card measure or create a new measure using this formula to get the average as needed. Let me know if you need any further adjustments!
I hope this helps.Thank you for your cooperation. Have a great day.
Regards,
Pallavi.
In the attached excel file total dyelot quantity 25 and total machine type of quantity 8.
I am getting default Dyelot quantity per Machine in BI file when divided with dyelot quantity and Machine type of Quantity. It's good.
Additionally, my requirements are if I select one machine one will divide with display dyelot quantity that will present in attached BI file in Bar visualization (default Dyelot per Machine).
Thus, if I select more machines, more machine numbers of quantities will divide with display dyelot quantity that will present in attached BI file in Bar visualization (default Dyelot per Machine).
Thus it will be work by a DAX. Please see the attached files and help me.
https://drive.google.com/file/d/106qZGsrfDdxEwzecL1bVAlHYOw_cWS1-/view?usp=sharing
https://drive.google.com/file/d/19PuLZO_cOpbv_9vp5C6L0EK_9N10npb2/view?usp=sharing