Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Is there a way to do something like this? I only want the TREATAS filter argument to evaluate if a condition evaluates to true, otherwise I'd like the CALCULATE function to ignore the TREATAS filter argument entirely.
=CALCULATE(
[Some Measure],
IF(
[Some Table Is Filtered],
TREATAS(
VALUES(Some Table[Column]),
'Other Table'[Column]
)
)
)
Hi @kappasig504 ,
Please try the following expression where [Some Table Is Filtered] needs to return true or false depending on your data writing.
VAR IsFiltered = [Some Table Is Filtered]
VAR Result =
IF(
IsFiltered,
CALCULATE(
[Some Measure],
TREATAS(
VALUES(Some Table[Column]),
'Other Table'[Column]
)
),
CALCULATE( [Some Measure])
)
RETURN
Result
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
10 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
8 |