Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
hi,
Below is imitation of database I link to Power BI.
So I need my Power BI report to ignore row with "Fixed" section name and split row's value between all other remaining sections (A, B and C) based on time. Example - row with section "A" shall get $12,500 from Fixed. Calculation: 40,000 * 5 days / (5+8+3). Row "B" would get 20,000 : 40,000 * 8 days / (5+8+3). And so on.
Is such data adjustment even possible in Power BI? I guess I need to create a new column which would take values form "Fixed" row and add to other existing rows. Can you please help me with DAX formula?
| Section | Value | Time |
| A | 20,000 | 5 |
| B | 30,000 | 8 |
| C | 15,000 | 3 |
| Fixed | 40,000 |
Solved! Go to Solution.
Value with Fixed =
var f = CALCULATE(sum('Table'[ Value ]),'Table'[Section]="Fixed")
var t = sumx(filter(all('Table'),[Section]<>"Fixed"),[Time])
var b = ADDCOLUMNS('Table',"v",f*[Time]/t)
return sumx(b,[v]+[ Value ])
Value with Fixed =
var f = CALCULATE(sum('Table'[ Value ]),'Table'[Section]="Fixed")
var t = sumx(filter(all('Table'),[Section]<>"Fixed"),[Time])
var b = ADDCOLUMNS('Table',"v",f*[Time]/t)
return sumx(b,[v]+[ Value ])
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 15 | |
| 6 | |
| 6 | |
| 5 | |
| 5 |