Simplifying DAX with Power BI Visuals

Aug 1, 2024

Notes on Power BI Visual Calculations

Introduction to DAX Complexity in Power BI

  • DAX formulas can be overwhelming, especially for beginners.
  • Visual Calculations aim to simplify writing DAX measures.
  • Directly reference fields in visuals for less hassle.

Overview of Visual Calculations

  • New feature introduced by Pal to create powerful reports easily.
  • Follow along with an example file provided in the video description.

Creating a Running Total with Visual Calculations

  • Previous Method: Writing complex DAX formulas.
  • New Method:
    1. Select the visual for the running total.
    2. Navigate to the Home tab and open the Visual Calculation pane.
    3. Click on FX to access various templates, including running sum.
    4. Select the necessary field (e.g., Sum of Sales).
    5. Result: Running total of sales by month appears in the visual.
  • Hiding Data:
    • Icons beside series allow hiding of certain values.
    • Cannot delete the underlying value used in visual calculations.

Drill Up and Down Functionality

  • Visual calculations respond to drill up and drill down functionalities.
  • Can also use slicers and filters on data.

Example of Moving Average Calculation

  • Moving average calculations were previously complex.
  • Using Visual Calculation:
    1. Open new calculation and select the moving average template.
    2. Specify the field (e.g., Sum of Sales) and window size (e.g., 3 months).
    3. Result: Easily calculated moving average appears.
  • Editing Calculations:
    • Click on the calculation to edit and make changes as needed.

Limitations of Visual Calculations

  • Limitations include not appearing in the field list like regular measures.
  • Cannot apply traditional number formatting.
  • Conditional formatting is currently not available for visual calculations.

Example of Percentage of Grand Total Calculation

  • Sales as a percentage of the grand total calculation:
    1. Create a new calculation named "Percent of Grand Total" dividing the sum of sales.
    2. Use new visual calculation function for collapsing to iterate through the dataset.
    3. Format the result using a custom number format within the calculation.
  • Using Right Click for Conditional Formatting:
    • Instead of visual calculations, right-click to show values as a percentage of the total for proper conditional formatting options.

Current Status and Recommendations

  • Visual calculations are a preview feature; limitations might change in the future.
  • Ensure the latest version of Power BI Desktop is being used.
  • Enable visual calculations in options and restart Power BI.

Conclusion

  • Visual calculations make data analysis more accessible.
  • Good for Excel users transitioning to Power BI.
  • Future videos will provide more guidance on using Power BI and visual calculations.