Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have a tables Load and Generation which are connected to table Timeseries through datetime. One datetime in Timeseries has multiple datetime in 'Load',which I filter by site. Similarly one datetime in timeseries has many datetimes in 'Generation'.
I am trying to calculate the difference between Load[Load] and Generation[Generation] row by row before aggregating.
My first attempt is below and it works for the lowest drill down level but it aggregated and then subtracts. I need it to subtract and then aggregate.
Load_Generation_diff =
SUM ( Load[Load] ) - SUM ( Generation[Generation] )
Using the related function also doesn't work. likely due to the Many to one relationship
Load_Generation_diff =
SUMX ( 'Load', Load[Load] - RELATED ( Generation[Generation] ) )
Hi,
try wrapping the calculations in CALCULATE TO change the context to row calculation:
Load_Generation_diff =
CALCULATE(SUM ( Load[Load] )) - CALCULATE(SUM ( Generation[Generation] ))
then aggregate this after
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Unfortunately that doesn't solve the problem.
You should get an idividual calculation per row that you can then sum.
What's happening when you use it?
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
I am sorry, I think I misunderstood the real problem.
I can calulated the 'Load_Generation_diff' per row now (as per your forumla) and I am trying to calculate another measure from it. This measure is called 'Generation Sold'
but as soon as I aggregate up (from hourly to daily), the 'Generation sold' doesnt show anything. I thought this was being 'Load_Generation_diff was no longer calculating per row (even with the new formula).
Sorry for not explaining the problem properly
Ah okay, i'm not sure without knowing the data model and fields - Are you able to share the PBIX file? or some sample data?
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
121 | |
79 | |
48 | |
38 | |
31 |
User | Count |
---|---|
192 | |
79 | |
70 | |
50 | |
42 |