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
pistachio
Helper I
Helper I

Troubleshooting Filter - Active Projects/Open Accounts

I have a table of accounts similar to this:

Account IDDate OpenedDate ClosedStatusProductTypeID
1500311D28/07/201516/01/20193C
71603222/06/201725/02/20193C
Z10001/04/200831/12/21001C

 

I'm attempting to calculate a graph of open accounts over time. DimDate is my calendar table, with all dates from 1/1/2016 to now. My slicer for DimDate is on the page. My formula for number of open accounts is:

# Loans Open = 
    CALCULATE(
				DISTINCTCOUNT(DimAccount[AccountID]), 
					FILTER(
						DimAccount,
							DimAccount[DateOpened] <= LASTDATE(DimDate[Date])
                            && OR(DimAccount[DateClosed] >= LASTDATE(DimDate[Date]), DimAccount[status] = 1)
                            && DimAccount[ProductTypeId] <> "D"
							) 

						) 

In this example my measure would return 2 with the date slicer set to 4 April 2018. The account "Z1000" is not recognised even though it is open on 4 April 2018. Any clues?

 

The date table (DimDate) has no direct relationship to the DimAccount table either through closing or opening date. There are some indirect relationships e.g Each account has a number of AccountLogs, each AccountLog has a Date which is related to the DimDate table.

1 REPLY 1
Anonymous
Not applicable

Hey @pistachio 

It's a bit hard (for me) to assist as you are missing the DimDate table.

How does it look like?

What is DimAccount[Pk]?

 

Please update your question with the correct details.

 

Cheers!
A

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.