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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
alex1888
New Member

Build an asset availability report

Hello, 

I have the following requirement that I'm not sure can be realized using Power bi. My data source is dynamics 365, And involved in the data structure 2 relevant entities Assets and Allocation to assets. 

 

Example of data structure:

Assets

Assets IDASSET NAME
1A1
2A2
3A4

 

Allocation to assets

Assets IDSTART DATEEND DATE
1October 1, 2021October 1, 2022
2September 15, 2021October 30, 2021
2November 30, 2021 October 1, 2022

 

The requirement to retrieve assets that are not occupied within the user's date range enters, In the example above the user is looking for a free asset between the dates October 30 to November 30 he is expected to get one result of property number A2.

 

We can ask the developers of dynamics 365 to add additional fields or data but do you think it can be realized using power bi?

 

Thank you very much for your help !

 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @alex1888 ,

 

Create a measure as below:

Measure = 
var _mindate=CALCULATE(MIN('calendar table'[Date]),ALLSELECTED('calendar table'))
var _maxdate=CALCULATE(MAX('calendar table'[Date]),ALLSELECTED('calendar table'))
var _tab=CALCULATETABLE(VALUES('Allocation to assets'[Assets ID]),FILTER(ALL('Allocation to assets'),'Allocation to assets'[END DATE]<=_mindate||'Allocation to assets'[START DATE]>=_maxdate))
VAR _names=CALCULATETABLE(VALUES(Assets[ASSET NAME]),FILTER(ALL(Assets),'Assets'[Assets ID] in _tab))
Return
CONCATENATEX(_names,'Assets'[ASSET NAME],",")

And you will see:

vkellymsft_0-1626161715400.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi  @alex1888 ,

 

Create a measure as below:

Measure = 
var _mindate=CALCULATE(MIN('calendar table'[Date]),ALLSELECTED('calendar table'))
var _maxdate=CALCULATE(MAX('calendar table'[Date]),ALLSELECTED('calendar table'))
var _tab=CALCULATETABLE(VALUES('Allocation to assets'[Assets ID]),FILTER(ALL('Allocation to assets'),'Allocation to assets'[END DATE]<=_mindate||'Allocation to assets'[START DATE]>=_maxdate))
VAR _names=CALCULATETABLE(VALUES(Assets[ASSET NAME]),FILTER(ALL(Assets),'Assets'[Assets ID] in _tab))
Return
CONCATENATEX(_names,'Assets'[ASSET NAME],",")

And you will see:

vkellymsft_0-1626161715400.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

amitchandak
Super User
Super User

@alex1888 , check the file attached. Treat the employee name as asset ID, and Leave date are occupied date. Now check the formula to show 0 for available and 1 for occupied. The asset table will act as one more dimension

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak thanks for the reply 😀, I admit I could not figure out the example you gave and the file.

 

But I may not have been clear - The table Allocation to assets Includes only data when the property IS NOT available I want to ask the opposite question, when the asset is available? Given your advice how to proceed?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors