Forum Discussion
DAX Switch Help
- 6 years ago
Hi yes
I was over complicating things and realised that I done need to switch/ look up a choice of many differenct percentages to apply to my table. In fact I only need to apply a choice of two percentages depending on my count results. See below.
Calc Targets = IF(AND([Comp Repairs]>=1,[Comp Repairs]<=10),"0.05")&IF(AND([Comp Repairs]>=10,[Comp Repairs]<=40),"0.1")
Hi
I am unable to add a sample report. But will try to explain
The results table is fine appart from the % column which is what I am trying to populate.
So If we tale line one as an example 'Team1' who completed just 6 jobs. I need to go and check my static percentages table and cross reference 6 jobs to find out what % need to be added to the results column called '%'
| Results Table (Changes based on dates slicer) | ||||
| Team | Repairs Completed (Count ROws) | % |
| |
| Team 1 | 6 | 16.7% | ||
| Team 2 | 10 | 20.0% | ||
| Team 3 | 8 | 12.5% | ||
| Team 4 | 5 | 20.0% | ||
| Team 5 | 8 | 12.5% | ||
| Team 6 | 14 | 14.3% | ||
| Team 7 | 12 | 16.7% | ||
| Team 8 | 10 | 20.0% | ||
| Team 9 | 12 | 16.7% |
| Table_Percentages (Static table) | |
| Jobs | % |
| 1 | 100.0% |
| 2 | 50.0% |
| 3 | 33.3% |
| 4 | 25.0% |
| 5 | 20.0% |
| 6 | 16.7% |
| 7 | 14.3% |
| 8 | 12.5% |
| 9 | 11.1% |
| 10 | 20.0% |
| 11 | 18.2% |
| 12 | 16.7% |
| 13 | 15.4% |
| 14 | 14.3% |
Hope this explains it
Hello to all responders. I manged to resolve this issue myself by rethinking and applying a more simplified solution.
- v-lili6-msft6 years ago
Community Support
hi cottrera
First, It's pleasant that your problem has been solved by yourself.
and for your case, I think there is another simple measure that try to use LOOKUPVALUE to get it:
Result = LOOKUPVALUE(Table_Percentages[%],Table_Percentages[Jobs],[Repairs])Regards,
Lin
- AllisonKennedy6 years ago
Community Champion
cottrera Awesome! Glad you resolved this. Please can you post what you did so we can all learn? Then you can mark it as the solution.
Cheers!- cottrera6 years ago
Post Prodigy
Hi yes
I was over complicating things and realised that I done need to switch/ look up a choice of many differenct percentages to apply to my table. In fact I only need to apply a choice of two percentages depending on my count results. See below.
Calc Targets = IF(AND([Comp Repairs]>=1,[Comp Repairs]<=10),"0.05")&IF(AND([Comp Repairs]>=10,[Comp Repairs]<=40),"0.1")