Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I've created a Calculation Group with two items: MTD and YTD.
When using this Calculation Group in a report, I get the error that I'm trying to compare an integer with a text.
Here's my DAX for both items:
MTD:
CALCULATE (
SELECTEDMEASURE(),
FILTER(
Dim_Date,
Dim_Date[Posting Period] = MAX(Dim_Date[Posting Period])
)
)
YTD:
CALCULATE (
SELECTEDMEASURE(),
FILTER(
Dim_Date,
Dim_Date[Posting Period] <= MAX(Dim_Date[Posting Period])
)
)
Posting Period is set to Whole Number in the dimension table.
I've tried using CONVERT and VALUE, but I still get the same error.
Hi, @Anonymous
I saw that you used 'SELECTEDMEASURE()' function in your dax code. I think perhaps the problem lies here. Because your formula has no syntax error. Why not write the measure directly in the report so that we can find the problem quickly. If you want to solve the problem, you need to provide more information and share it.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , This error can come if the Posting Period is text. has <= operation might create a problem. But overall seems fine.
Can you share a sample pbix after removing sensitive data.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |