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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Question re matrix visualization filtering

Hello all, I have matrix visualization in the following format (see below) - categories of things with summary of their counts per month (its timeseries data). I only want to see in the matrix categories where counts are more than 1 for this month, but i want to see values of them for the previous months too. How do I do that?

 

E.g. in the example below i only want to see S3/S1/S2 categories because their counts are more than 1 for february, but i want to see their for the whole data range.

sabinih88_0-1612475426731.png

 

1 ACCEPTED SOLUTION

@Anonymous 

You are getting the error because your fields 'TableName'[TimestampUTC].[Month] and/or 'TableName'[TimestampUTC].[Year] are not type integer (they are type text).

MONTH(TODAY()) returns the current month's number, therefore an integer.

YEAR(TODAY()))) returns the current year's number, therefore an integer.

So you either convert both your fields to type integer (using VALUE) or you convert the above expressions to type text (using FORMAT).

 

Apologies since I should have made the measure clearer. So:

Counts this month = CALCULATE([your count measure], FILTER(Date table, Date table [Month Number] = MONTH(TODAY()) && Date table [Year Number] = YEAR(TODAY())))

Try:

CountsThisMonth = CALCULATE(COUNTROWS('TableName'), FILTER('TableName', VALUE('TableName'[TimestampUTC].[Month]) = MONTH(TODAY()) && VALUE('TableName'[TimestampUTC].[Year]) = YEAR(TODAY())))





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

4 REPLIES 4
Anonymous
Not applicable

@PaulDBrown  I see, I get the logic of expression now. I modified it a little bit, and it worked beautifully. Thank you!

 

CountsThisMonth = CALCULATE(COUNTROWS('TableName'), FILTER('TableName', MONTH('TableName'[TimestampUTC]) = MONTH(TODAY()) && YEAR('TableName'[TimestampUTC]) = YEAR(TODAY())))

 

PaulDBrown
Community Champion
Community Champion

@Anonymous 

Try:

Counts this month = CALCULATE([your count measure], FILTER(Date table, Date table [Month] = MONTH(TODAY()) && Date table [Year] = YEAR(TODAY())))

Final Measure = SUMX(Date table, IF(NOT(ISBLANK([Counts this month])), [Your count measure]))





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.






Anonymous
Not applicable

@PaulDBrown  thank you! i tried it and i got an error, what do i do wrong?

CountsThisMonth = CALCULATE(COUNTROWS('TableName'), FILTER('TableName', 'TableName'[TimestampUTC].[Month] = MONTH(TODAY()) && 'TableName'[TimestampUTC].[Year] = YEAR(TODAY())))

Mdxscript(model) (4,148) Calculation error in measure 'Tablename'[CountsThisMonth]:DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.

@Anonymous 

You are getting the error because your fields 'TableName'[TimestampUTC].[Month] and/or 'TableName'[TimestampUTC].[Year] are not type integer (they are type text).

MONTH(TODAY()) returns the current month's number, therefore an integer.

YEAR(TODAY()))) returns the current year's number, therefore an integer.

So you either convert both your fields to type integer (using VALUE) or you convert the above expressions to type text (using FORMAT).

 

Apologies since I should have made the measure clearer. So:

Counts this month = CALCULATE([your count measure], FILTER(Date table, Date table [Month Number] = MONTH(TODAY()) && Date table [Year Number] = YEAR(TODAY())))

Try:

CountsThisMonth = CALCULATE(COUNTROWS('TableName'), FILTER('TableName', VALUE('TableName'[TimestampUTC].[Month]) = MONTH(TODAY()) && VALUE('TableName'[TimestampUTC].[Year]) = YEAR(TODAY())))





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.






Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors