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
mmorley
Frequent Visitor

Measure based on a multi-select slicer

Hi,

I'm trying to create a measure that obtains a count of records based on the records listed in the relevant months from the slicer selection.

 

I can get the list of months using

Multi_Selected_Months = CONCATENATEX ( VALUES ( TaskRange[Month] ), [Month], ",")

But when I use following or try different filters, I can't get the results I',m after

TotalTasks = 
Return
COUNTROWS(
    FILTER(
        All(TaskRange),
       TaskRange[Month]=[Multi_Selected_Months])
)

Someone might select january, february, may, august and I only need to see the totals for the months selected.

If I do a datebetween the first and last date selected this is fine

 

Any help appreciated

 

Thanks

1 ACCEPTED SOLUTION
mmorley
Frequent Visitor

Thanks all,

 

Managed to resolve it using the month table with the count of measure entries, I created another card that just used this and summed the values up for the selected months

 

View solution in original post

5 REPLIES 5
mmorley
Frequent Visitor

Thanks all,

 

Managed to resolve it using the month table with the count of measure entries, I created another card that just used this and summed the values up for the selected months

 

mmorley
Frequent Visitor

I've created a table for the dates to choose (to confirm it has no bearing on the issue), along with the totals for each month 

 
AllMonths = Distinct ( TaskRange[Month])
Total = COUNTROWS(FILTER(ALL(TaskRange),TaskRange[Month] = AllMonths[Month]))
 
MonthTotal
1/1/202255
1/2/2022145
1/3/2022543
1/1/20237
1/10/202115
1/11/2022325

 

The user can select mutliple dates from the range using a splicer and not in sequential format, so may choose 1/1/2022, 1/3/2022, 1/11/2022

 

I need to be able to add the totals for each month to get an overall figure which should be 55 + 543 + 321 = 919

 

But what happens is that I get blank as it only works for one month, i can't use other formulas as it seems to add everything that occurs between the min and max date

 

 

You could use TREATAS with your date slicer table

Total = CALCULATE( COUNTROWS(TaskRange), TREATAS( VALUES('Month Slicer'[Month]), TaskRange[Month]) )
mmorley
Frequent Visitor

The table I'm using already has a date range on it as it would appear in a seperate table, and is fine for all my other visuals as they are filtered on categories.

 

I'm creating another visual multi-card that contains a total count of all tasks within the range selected no matter what category they are and then another measure gets the total for the category to then do a percentage.

 

The measure based on the category within the range is correct, it's the overall I'm having an issue with

johnt75
Super User
Super User

Set up a proper date table and link that to your TaskRange table. Use columns from the Date table on your visuals, including the slicer, and your measure becomes simply

Total tasks = COUNTROWS( 'TaskRange')

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