Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have two unrelated tables that I am trying to perform a simple SUMIF calcluation on. I can easily do this in Microsoft Excel but am struggling to get it completed in Power BI. The simplified scenario is described below. Both tables in my Power BI model are loaded using DirectQuery.
Table1: Sales Summary
Column B: Equivalent Payroll Finish Date
Column C: Revenue
Table2: Payroll
Column B: Payroll Finish Date
Column C: Payroll Amount
Column E (Calculated): Same Finish Date Revenue
In 'Table2 [Column E]' I'm trying to calculate the total revenue for the same payroll finish date listed in Table1. This is easily completed in excel using the following formula: "=SUMIF('Sales Summary'!$B$3:$B$7,Payroll!B3,'Sales Summary'!$C$3:$C$7)"
How could I go about completing this in Power BI? I can't get the "CALCULATE(SUM..." function to filter properly.
Thank you for any help as I've been working on this for a couple days now!
Solved! Go to Solution.
Hi @dti,
Create a calendar table in the current database of SQL Server which you get data from following the guide in this blog, then import the calendar table to your current Power BI Desktop file, and link the calendar table to Sales summary table and Payroll table using Datekey.
This way, you will be able to get your desired result after creating a table visual by using datekey of calendar table and Payroll Amount solumn of Payroll table and Revenue of Sales summary table .
Thanks,
Lydia Zhang
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
116 | |
102 | |
77 | |
77 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |