Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi there,
I have a matrix table with numerous different values for different timescales, I wanted to know how to get a value for the current month? It's more complex than I thought.
I have a simple measure called [User Count] which is what I need counting over the time period, then I have a date table built around [active_date] as shown below:
Hi @Anonymous ,
Please use the column from the date table "Dates" as the fields of table visual?
And measure like the following expression:
Measure =
CALCULATE (
[User Count],
FILTER (
ALLSELECTED ( 'Candidate Activity' ),
YEAR ( 'Candidate Activity'[active_date] ) = SELECTEDVALUE ( Dates[year] )
&& MONTH ( 'Candidate Activity'[active_date] )
= SELECTEDVALUE ( Date[MonthNumber] )
)
)
Or you can share some example data and expect result if you need more help.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-chenwuz-msft
Thank you for the response, the measure had no errors itself, but when I put it into a visual it has an error, and this is the error:
Error Message:
MdxScript(Model) (40, 16) Calculation error in measure 'Candidate Activity'[In last Month]: DAX comparison operations do not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.
I'm not sure why this is? I shouldn't convert the [active_date] should I?
Hi @Anonymous ,
Please change the type of the two columns in your table which you have mentioned in this measure.
Or use the VALUE or FORMAT function to convert one of the values.
If you need more help, please share your pbix file without sensitive data.
Best Regards
Community Support Team _ chenwu zhu
Hi @v-chenwuz-msft
I've changed the [MonthNumber] column in dates table to a whole number, but now the data is just blank, here is what it looks like when I put it on my visual below:
This is what the date table looks like below:
I did notice that when I converted the MonthNumber into a wholenumber it went from 01 to 1, 02 to 2, etc. Could this be the problem maybe? Or does that not matter?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
13 | |
11 | |
8 |