Forum Discussion
chris_steins
5 years agoNew Member
DAX Formula
I'm looking to lookup a value in a data table and make a calculation based on it. Below is my example table, where I'm trying to calculate the "percent Change" column where I want to look up in the ...
- 5 years ago
percent Change = VAR num_ = Table1[Value] VAR denom_ = CALCULATE ( AVERAGE ( Table1[Value] ), ALLEXCEPT ( Table1, Table1[Location] ), Table1[Rate] = 0 ) RETURN DIVIDE ( num_, denom_ )Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- 5 years ago
See it all at work in the attached file.
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
chris_steins
5 years agoNew Member
The suggested code gives me the error of multiple values was supplied where a single value was expected.
Probably because of my followup where there are multiple lines that need averaged.
Another example table.
| Person | Rate | Value | Location |
| A | 0 | 5 | UN |
| A | 1 | 6 | UN |
| A | 2 | 4 | UN |
| A | 0 | 6 | VD |
| A | 1 | 7 | VD |
| A | 2 | 5 | VD |
| A | 0 | 8 | UN |
| A | 1 | 5 | UN |
| A | 2 | 6 | UN |
| A | 0 | 7 | VD |
| A | 1 | 8 | VD |
| A | 2 | 9 | VD |
| B | 0 | 8 | UN |
| B | 1 | 7 | UN |
| B | 2 | 5 | UN |
| B | 0 | 9 | VD |
| B | 1 | 8 | VD |
| B | 2 | 7 | VD |
| B | 0 | 4 | UN |
| B | 1 | 5 | UN |
| B | 2 | 2 | UN |
| B | 0 | 8 | VD |
| B | 1 | 6 | VD |
| B | 2 | 8 | VD |