Forum Discussion
IF Statement Help
- 9 years ago
Hi New2PowerBI,
In your scenario, please add a calculated column in the table(in my test, it's named 'Fact Table') which contains thousands of records using below DAX formula:
KEY = LOOKUPVALUE ( 'Key Table'[Annual WO Impact], 'Key Table'[FREQUENCY], 'Fact Table'[FREQUENCY], 'Key Table'[FREQUNIT], 'Fact Table'[FREQUNIT] )Thanks,
Yuliana Gu
Here is a visual of what I have:
| FREQUENCY | FREQUNIT | Annual WO Impact |
| 1 | MONTHS | 12 |
| 1 | WEEKS | 52 |
| 1 | YEARS | 1 |
| 2 | MONTHS | 6 |
| 2 | WEEKS | 26 |
| 2 | YEARS | 1 |
| 3 | MONTHS | 4 |
| 3 | YEARS | 1 |
| 4 | YEARS | 1 |
| 5 | YEARS | 1 |
That is one table; then I have another Table that has thousands of records and each record has a FREQUENCY and FREQUNIT, but not an Annual WO Impact. What I want is to add a column to the table that notes what the Annual WO Impact is according to this key, first step, and then once that is in place I think I can multiply the value by "x" number of $ and get a cost for that line item. Does that help?
What you could do:
1) In both tables create a key column concatenating the frequency and the unit, delemited by a special character like "_"
Key = [FREQUENCY] & "_" & [FREQUNIT]
2) relate the tables by these columns
3) because it is an many:1 relationship you can now access the [Annual WO Impact] column as it were in the same table and do your calculations
Hope this helps
JJ
- New2PowerBI9 years agoHelper III
Thanks for your response!