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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
umekuro
Helper II
Helper II

How to get the number from the third case per year

Hi,

I have the fact data above.
I do not know the measure to get the ExpectedValue column of the table below.
The condition is that I want to display only the number of cases that exceed 3 per year.
Can anyone give me some advice on how to do this?

Thank you in advance.

 

DateValue
2021/4/31
2021/7/101
2021/7/222
2021/9/31
2021/9/91
2021/11/101

 

umekuro_0-1650070119422.png

 

1 ACCEPTED SOLUTION

Ok, I think this is what you are after:

values after 2 cases =

VAR threshold = 

CALCULATE(SUM(Table[Value]),

FILTER(ALL(DateTable), DateTable[Date]<=MAX(DateTable[Date])))

VAR Countfrom =
MINX(FILTER(Date table, threshold = 3), Date[Date])

RETURN

CALCULATE(SUM(Table[Value]), FILTER(Date Table, Date Table[Date]>= Countfrom))





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

10 REPLIES 10
PC2790
Community Champion
Community Champion

Can you elaborate on your requirement?

> Do you need a new column in the existing table?

> Do you need the number of cases per year as per month or the third case per year?

Dear PC2790,

 

Thank you for your advice.
I want to represent the numbers in the red box with a table visual like the one below.
And it needs to be a measure.
For your second question,

I want to get value counted from the third case, not three cases per month, but from the third case cumulatively by year.
In the data above,
1 in April, but it haven't reached 3 for the year yet, Not counted.
3 in July, count the two cases after reaching three cases for the year,

and the months after that,

the number of cases has reached 3.
All will be counted.

I hope this helps.

Assuming you have a number value for YearMonth, Try:

sum>2=

CALCULATE(SUM(Table[Value]),

FILTER(ALL(Table), Table[YearMonthNum]<=MAX(Table[YearMonthNum])))

Now add the [sum>2] measure to the filter pane and set the value to greater or equal to 3

 

If you are using a date table, use:

sum>2=

CALCULATE(SUM(Table[Value]),

FILTER(ALL(DateTable), DateTable[Date]<=MAX(DateTable[Date])))





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Dear PaulDBrown,

 

Thank you for your advice. 

Sorry for my lack of explanation.
The matrix visual I want to create cannot use the filter pane because I want to include other measures in one Matrix Visual.
The value below and now the expected value and other columns will also be displayed in one matrix.
Is there any solution to this problem?

I would like to add that I use the date table.

BR

umekuro_0-1650107514633.png

 

In that case,  try

sum>2=
VAR _ calc =

CALCULATE(SUM(Table[Value]),

FILTER(ALL(DateTable), DateTable[Date]<=MAX(DateTable[Date])))
RETURN

IF(_calc >2, SUM(Table[Value]))





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you,

 

I tried your advice,

Unfortunately, we did not get the numbers we were looking for.
We want the numbers to be in the red.
Sorry if my explanation is not good enough.

umekuro_0-1650111408906.png

 

Why is the first Value = 2, if the column value is 3?

to get the correct totals change the measure to:

 

sum>2=
SUMX(Date Table, 

CALCULATE(IF(

CALCULATE(SUM(Table[Value]),

FILTER(ALL(DateTable), DateTable[Date]<=MAX(DateTable[Date]))) > 2, SUM(Table[Value]))
)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Sorry for the confusion.
value is the number of cases.
It does not count up to two per year.
I want to count the third case as the first, so
One in April 2021 and the first of three in July 2021.
The count will be disqualified and there will be two cases in July.
Is that an explanation for your Measure?

Ok, I think this is what you are after:

values after 2 cases =

VAR threshold = 

CALCULATE(SUM(Table[Value]),

FILTER(ALL(DateTable), DateTable[Date]<=MAX(DateTable[Date])))

VAR Countfrom =
MINX(FILTER(Date table, threshold = 3), Date[Date])

RETURN

CALCULATE(SUM(Table[Value]), FILTER(Date Table, Date Table[Date]>= Countfrom))





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you so much.

I'll try it!

 

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 Kudoed Authors