Menu
Stuff by Yuki
  • Home
  • Python
  • Power BI
  • Tableau
  • Community
    • Makeover Monday
    • Workout Wednesday
  • About
  • Contact
Stuff by Yuki

How Do You Create DAX Tables?

Posted on May 19, 2021July 28, 2021

WoW 2021 Week20 – Power BI

Workout Wednesday exercises are always great! This time I created tables utilizing DAX SUMARRIZE function. I didn’t have much experience with that function prior, but it seems pretty straight forward.

CALCULATE function comes in to play for a lot of cases.

Here is some code I created to get the percentage sales for each year so as to using it in a bar chart showing the percentage by region.

Total Sales - DAX Table 2 = CALCULATE( [Sum of Sales], ALLEXCEPT( orders, orders[Year] ))
DAX Table 2 = SUMMARIZE (
        orders,
        orders[Year],
        orders[region],
        "Sales", [Sum of Sales],
        "Total Sales", [Total Sales - DAX Table 2],
        "% Total Sales",
            DIVIDE (
                [Sum of Sales],
                [Total Sales - DAX Table 2]
    ))

DAX is really flexible in that you can adjust it depending on how you need to show your data. The more you work with DAX, the better you understand how it works in each case!

Data Source | Source Code

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How to Convert String to Date or Datetime in Polars
  • Aggregations Over Multiple Columns in Polars
  • DuckDB with Polars, Pandas, and Arrow
  • Read from and Write to Amazon S3 in Polars
  • Handling Missing Values in Polars

Popular Posts

  • A Running Total Calculation with Quick Measure in Power BI
  • How To Copy And Paste Report Page in Power BI
  • How to Fill Dates Between Start Date and End Date in Power BI (Power Query)
  • Year-Over-Year Calculation: Time Intelligence in Power BI
  • Network Visualizations in Python

connect with me

  • LinkedIn
  • Twitter
  • Github
©2023 Stuff by Yuki | Powered by SuperbThemes & WordPress