Forum Discussion

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

Custom total value for measure

Hi, I'm trying to get a specific total value, but I'm not sure how can I achieve it. So I've got two variables "Densidade" and "FX Quimicos". The way my deviation formula works, I can get the total...
  • 123abc's avatar
    2 years ago
    1. Create Individual Deviation Measures:

      • Ensure you have separate measures for "Densidade" deviation and "FX Quimicos" deviation.
    2. Create a New Measure for Total:

      • Create a new measure for the combined deviation. You can use a formula like this:

    Total Deviation = [Densidade Deviation] + [FX Quimicos Deviation]

     

    1. Display Total Deviation in Visuals:

      • Use the "Total Deviation" measure in your visuals. It should now correctly display the sum of individual deviations when both "Densidade" and "FX Quimicos" are selected.
    2. Handle Slicer Interaction:

      • Make sure that your measures are not affected by slicer interactions if you want to see the total regardless of the slicer selections. You can use functions like ALL or ALLSELECTED to remove any slicer context when calculating the total.

    Here's an example of how you might adjust your measure to handle slicer interactions:

     

    Total Deviation =
    CALCULATE(
    [Densidade Deviation] + [FX Quimicos Deviation],
    ALL('YourTableName'[YourSlicerField])
    )

     

    Replace 'YourTableName' and 'YourSlicerField' with the appropriate table and field names.

    Remember that DAX measures should reflect the logic you want in your visualizations. Adjust the calculations based on your specific data model and requirements.

    If you encounter specific issues or have more details to provide, feel free to share the relevant parts of your DAX code or describe the issue, and I'll do my best to assist you.