The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
13 | |
13 | |
8 | |
8 |