2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

[DAX/Data Modeling] filtering years and calculating Measures across tables

Our take

Are you feeling bogged down by the complexities of data modeling in Excel? If you’re looking to filter years effectively or calculate measures across tables, you’re not alone. Many users encounter challenges when trying to harness the full power of DAX in Power Pivot. In this introduction, we’ll explore how to filter your data to focus solely on 2020 and 2021, and we’ll break down the best practices for calculating Total Sales seamlessly across related tables.

Hi everyone,

I'm working on a data model in Excel (Power Pivot) and I'm stuck on two specific issues. I’m relatively new to DAX and would love some guidance.

Problem 1: Filtering Years I want to restrict my data/report to show only 2020 and 2021. I need to exclude 2022 entirely from the calculation. Is it better to do this via a Filter in the Pivot Table, or should I bake this logic into a DAX measure using CALCULATE?

Problem 2: Calculating across tables I need to calculate Total Sales, but the data is split:

  • Table A (Sales): Contains Units Sold.
  • Table B (Products): Contains Unit Price. There is a relationship between these tables based on ProductID. How do I write a measure that pulls the price from Table B to multiply by the units in Table A? I've tried a few things, but I keep getting errors because they are in different tables.

Any help or “best practice” advice would be greatly appreciated!

All files are from Excel is fun YouTube channel

the mention sheets are R DM DAX and HW4

File Link

submitted by /u/Bassiette03
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

Related Articles