Forum Discussion

Fantmas's avatar
Fantmas
Icon for Helper III rankHelper III
2 years ago
Solved

DAX Calculation do not show me total in table visual

Hi Everyone, I am facing an issue, I create a measure to solve a business case to compare if the value of cat A is greater than cat B in 2024 if not then I have to calculate the difference between...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Fantmas ,

     

    I made an attempt and you can check the results below:

    Measure = var _select = SELECTEDVALUE('Time'[Year])
    var _A = CALCULATE(SUM('Table'[Value]),FILTER('Table',[Year]=_select&& [category]="A"))
    var _B = CALCULATE(SUM('Table'[Value]),FILTER('Table',[Year]=_select&& [category]="B"))
    var _preB = CALCULATE(SUM('Table'[Value]),FILTER('Table',[Year]=_select -1 && [category]="B"))
    RETURN IF(_A>_B,"Yes",ABS(_B-_preB))

     

    An attachment for your reference. Hope it helps!

     

    Best regards,
    Community Support Team_ Scott Chang

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.