Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
BaronSdG
Helper V
Helper V

Compute delta of values in the same column depending on two category columns

Hi all,

 

I have a table with the following 3 relevant columns:

  • Start date
  • Maturity Date
  • Amount value

 

My goal is to create the following visual, where for each time period (month, year) I show the Start date amount minus Maturity date Amount (e.g. for 10 January I will have let's say 2 rows with Start date = 10 January and 4 other rows with Maturity date = 10 January. I want the delta of the amount of these 6 rows such as (sum of the 2 Start date rows amount) - (sum of the 4 Maturity date rows amount).

 

BaronSdG_1-1643136999723.png

For now, I solved by duplicating the fact table and connecting both of them to the calendario table with the different dates (one is connected with Starts, other with Maturity). See below  

BaronSdG_2-1643137351923.png

 

The issue is that if I want to add new data, I have to add such data to both the original fact table and the duplicate table

 

Does anyone have a solution to have the same result but without duplicating the fact table?

 

Thanks

 

Stefano

1 REPLY 1
amitchandak
Super User
Super User

@BaronSdG , You need to create a common date table. Join it with both dates. One join will be inactive that you need to activate using userelationship 

 

Assume start date is active, then ,measure is

sum(Table[Amount value])

 

and  Maturity Date is inactive

calculate(sum(Table[Amount value]) , USERELATIONSHIP ('Date'[date], Table[Maturity Date]))

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.