Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
hi,
i have a Claim table and a Date table. They are not related to each other, only through the Claim Payment Fact. However, because some claims do not have a Payment, not all claims are represented in the Claim Payment Fact.
What i want to do is count how many Claims were open (via a count of Claim Number from the Claim Table) during a particular Month and Year (i.e Dec 2019, Jan 2020, etc...). I have a column in the Date table called Date Month Year so i can use that on the visual.
What i am having trouble with is how to count the number of claims for each month year when i don't have a direct relationship between the Claim and Date tables. I have a Claim Status in the Claim Table that should be either "Open" or "Closed", and i also have a Date Of Loss column in the Claim table as well that tells me when the claim occurred and a Claim Close Date column for when the claim was closed.
So what i need is for each Month Year in the Date table, see how many claims from the Claim table that occurred before that date and status were open. So for example if i only had 2 claims today in the claim table and claim 1 occurred in Jan 2020 and claim 2 occurred in Feb 2020 and they were both Open, i should see the following when i drag Month Year from Date table and the measure of count open claims:
Month Year Count Open Claims
Jan 2020 1
Feb 2020 2
March 2020 2
Now if Claim 1 closed in March 2020, then i should see this instead:
Month Year Count Open Claims
Jan 2020 1
Feb 2020 2
March 2020 1
thanks
scott
Please try an expression like this to get your result. It will count the number of open claims during date period in scope.
NewMeasure =
VAR mindate =
MIN ( Date[Date] )
VAR maxdate =
MAX ( Date[Date] )
RETURN
COUNTROWS (
FILTER (
Claim,
Claim[Date of Loss] <= maxdate
&& Claim[Claim Close Date] >= mindate
)
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
This version gets me the same numbers as my original code, but still gives me the future months (which i don't want):
Hi,
so what is missing here is claims that are still open (basically claims without a closed date). What i need is sort of a cumulative count of open claims for each time period. So for each period i need claims that are currently open for that period (so if we are in Jan 2020, it would be claims that have a loss date < 1-31-2020 and are in status "Open", and also claims that are in a status of "closed" but have a close date > 1-31-2020 since those claims were open during Jan 2020.
My script above seems to do it, but the issue i had was that i was getting values for future months because my date table has dates for all of 2020. I was trying to figure out how to either remove those future months or show blanks for the values.
@scabral , This data dows not look like base data. Can you share sample data and sample output in table format?
refer if this can help
HI,
so i was able to get some DAX working like this which gives me the number of open claims within the period as well as closed claims that were open within the period but closed after the period:
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |