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

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.

Reply
ljx0648
Helper I
Helper I

Summing assets based on dates from another table

Hi guys,

 

I have two tables already connected in powerbi (using both "date" column in the table)

 

ljx0648_0-1676664053976.png

Last date of previous fiscal refers to the last date of the previous fiscal year (New fiscal starts Nov 01 every year)

 

ljx0648_1-1676664065896.png

The result I am hoping to get as per below:

ljx0648_3-1676664240516.png

 

In summary, I want to get the sum of current asset group by customer and date in the asset table. At the same time, also another column with the sum of asset group by "last date of previous fiscal" from the calendar table as well.

 

The purpose of this exercise is to compare the current asset Nov 2019, Dec 2019, Jan 2020 so on... to the Asset on the last date of the previous fiscal to track growth.

 

Any suggestion would be much appreciated.

 

Thank you

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you! This works like a charm

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
sevenhills
Super User
Super User

You can have a measure as below:

sevenhills_3-1676667051457.png

 

Asset Last Date of previou fiscal = 

var _selD = SELECTEDVALUE(SumAssets_AssetTable[Date])
var _val = CALCULATE( Max(SumAssets_CalendarTable[Last Date of Previous Fiscal]), FILTER(SumAssets_CalendarTable, SumAssets_CalendarTable[Date] = _selD))
var _asset = CALCULATE(sum(SumAssets_AssetTable[Current asset]), SumAssets_AssetTable[Date] = _val)

RETURN if ( HASONEVALUE(SumAssets_AssetTable[Date]), _asset)

 

 

Say, you have the relationship as below:

sevenhills_0-1676666962823.png

 

Data as

sevenhills_1-1676666991910.png

Output will be as

sevenhills_2-1676667007420.png

To display exactly your needs, you can filter the visual as 

sevenhills_4-1676667195501.png

 

Hope this helps!

Thank you for your quick response! I will try to apply this measure after I have access to my data next week.

Much appreciated!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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