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
SebaSpotti
Advocate II
Advocate II

Using a measure to define a CALCULATETABLE

Hi, I'm creating a CALCULATETABLE  in this way:

 

CalcTable= CALCULATETABLE(Table,
Table[Name] in {"A","C","F},
Month(Table[Date])=Table[ExamMonth]))
 
But i get an error. Note that 'Table'[ExamMonth] is a measure, if I insert directly a number, such as 4, the CalcTable get generated.
 
Any suggestions?
Thanks!
1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @SebaSpotti ,

 

you can try the following:

CalcTable =
VAR _ExamMonth = [ExamMonth]
RETURN
    CALCULATETABLE (
        Table,
        Table[Name] IN { "A", "C", "F" },
        MONTH ( Table[Date] ) = _ExamMonth
    )

 

I'm wondering, what exactly do you plan to do?
Do you want to use that in a measure or do you want to use that as a calculated table? Be aware if you are using a calculated table, that table is not dynamic. So after loading the file, the table won't change anymore.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

View solution in original post

2 REPLIES 2
selimovd
Super User
Super User

Hey @SebaSpotti ,

 

you can try the following:

CalcTable =
VAR _ExamMonth = [ExamMonth]
RETURN
    CALCULATETABLE (
        Table,
        Table[Name] IN { "A", "C", "F" },
        MONTH ( Table[Date] ) = _ExamMonth
    )

 

I'm wondering, what exactly do you plan to do?
Do you want to use that in a measure or do you want to use that as a calculated table? Be aware if you are using a calculated table, that table is not dynamic. So after loading the file, the table won't change anymore.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

@selimovd thank you!

 

I was simply trying to calculate some measure, but probably i need them to be update so i'm changing the calculations.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.