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 September 15. Request your voucher.
How do I calculate the distributed value, using DAX, as shown in the example below?
Customer | Value | Distributed value |
blank | 20 | 0 |
customer1 | 40 | 50 |
customer2 | 40 | 50 |
I have some sales for which I don't have clients registered (cash transactions), and I'd like to distribtue the value over the other customers
Solved! Go to Solution.
Hi, @Steven-conance
Please try formula like:
Distributed percentage(not blank) =
var total=CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Customer]<>"blank"))
return IF(SELECTEDVALUE('Table'[Customer])="blank",0,SELECTEDVALUE('Table'[Value])/total)
Distributed value =
var total=CALCULATE(SUM('Table'[Value]),ALLSELECTED())
return total*[Distribute percentage(not blank)]
Best Regards,
Community Support Team _ Eason
Hi, @Steven-conance
Please try formula like:
Distributed percentage(not blank) =
var total=CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Customer]<>"blank"))
return IF(SELECTEDVALUE('Table'[Customer])="blank",0,SELECTEDVALUE('Table'[Value])/total)
Distributed value =
var total=CALCULATE(SUM('Table'[Value]),ALLSELECTED())
return total*[Distribute percentage(not blank)]
Best Regards,
Community Support Team _ Eason
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
12 | |
9 | |
7 |