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
jwillis07
Advocate I
Advocate I

How to include a secondary filter within this measure?

Hi all, hoping you can help me with something...

 

Say I have Table1, with the below columns:

  • id
  • date
  • type

 

I've written this measure, and by written, I mean copied off the internet somewhere and can't remember where:

 

cumulative = 
CALCULATE(
	COUNTA(Table1[id]),
	FILTER(
		ALLSELECTED(Table1[date]),
		ISONORAFTER(Table1[date], MAX(Table1[date]), DESC)
	)
)

 

 

Which then produces this visual by adding the date column to the x-axis, and the measure as a line value:

snip_visual.JPG

 

So my question is: How can I incorporate a second filter where the column "type" is "A"?

 

The aim is to replace this singular line with 4, one for each type, "A", "B", "C" & "D"

 

Thank you in advance!

1 ACCEPTED SOLUTION

cumulative =
CALCULATE(
    COUNTA(Table1[id]),
    FILTER(
        ALLSELECTED(Table1[date]),
        ISONORAFTER(Table1[date], MAX(Table1[date]), DESC)
    ),Table[Type] == "A"
)
Just Change A for the other three measure then put all the measures

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



View solution in original post

6 REPLIES 6
Samarth_18
Community Champion
Community Champion

Hi @jwillis07 ,

 

Please try this:-

cumulative = 
CALCULATE(
	COUNTA(Table1[id]),
	FILTER(
		ALLSELECTED(Table1[date]),
		ISONORAFTER(Table1[date], MAX(Table1[date]), DESC) && 
                Table1[type] in {"A","B","C","D"}
	)
)

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi, thanks for the response. Tried this but it doesn't seem to work unfortunately as it won't allow me to add Table1[type] - the type part is greyed out.

 

I think maybe it's something to do with the ALLSELECTED part.

 

Whenever I type... Table1[ ... The autofill options only show me the table, the date column and a different measure in this table - won't allow me to enter any other column names.

mh2587
Super User
Super User

You can simply use page filter by selecting type A,B, or C 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Hi, thanks for the response. Yeah you're right in that I could just apply add 'type' to the page filter but that wouldn't allow for me to have 4 lines in one visual, one for each type.

cumulative =
CALCULATE(
    COUNTA(Table1[id]),
    FILTER(
        ALLSELECTED(Table1[date]),
        ISONORAFTER(Table1[date], MAX(Table1[date]), DESC)
    ),Table[Type] == "A"
)
Just Change A for the other three measure then put all the measures

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Yep, this is it. Thank you very much, really appreciate it.

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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