Forum Discussion
DAX PROBLEM
- 3 years ago
Hello jamc,
Knowing nothing about your data model, something like the below should work. I assumed that excess/shortage were measures and that company was a column in the table. Adjust the measure as necessary.
Status = VAR CompanyAExcess = CALCULATE ( [Excess], REMOVEFILTERS ( Table1[Company] ), Table1[Company] = "Company A" ) VAR CompanyBShortage = CALCULATE ( [Shortage], REMOVEFILTERS ( Table1[Company] ), Table1[Company] = "Company B" ) VAR CompanyCShortage = CALCULATE ( [Shortage], REMOVEFILTERS ( Table1[Company] ), Table1[Company] = "Company C" ) RETURN IF ( CompanyAExcess <= MAX ( CompanyBShortage, CompanyCShortage ), "Opportunity" )
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
Hello jamc,
Knowing nothing about your data model, something like the below should work. I assumed that excess/shortage were measures and that company was a column in the table. Adjust the measure as necessary.
Status =
VAR CompanyAExcess =
CALCULATE (
[Excess],
REMOVEFILTERS ( Table1[Company] ),
Table1[Company] = "Company A"
)
VAR CompanyBShortage =
CALCULATE (
[Shortage],
REMOVEFILTERS ( Table1[Company] ),
Table1[Company] = "Company B"
)
VAR CompanyCShortage =
CALCULATE (
[Shortage],
REMOVEFILTERS ( Table1[Company] ),
Table1[Company] = "Company C"
)
RETURN
IF (
CompanyAExcess <= MAX ( CompanyBShortage, CompanyCShortage ),
"Opportunity"
)
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)