Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I'm trying to achive the following:
Metric | Value1 | Measure |
Test1 | 0 | 9999 |
thisisatest | 9999 | false |
Test3 | 1234 | false |
Ive writteh the following DAX formula:
Solved! Go to Solution.
I got it to work 🙂
I had to use a filter in my calculation.
Thank you for you help!
Hi there,
@Anonymous wrote:"It works well if the data source is excel but it doesn't work if I'm using a stored prodedure (SQL Server)Both are direct imports."
Are you using Direct Query or Import?...
If you are using import, there should be any difference in how to calculate a measure.
Check if your datatypes are set up the same.
Oh sorry, I'm using import.
My data types are the same in both.
I also tried to assign a variable for the CALCULATE() statement and use that in the IF statement. The variable returns the correct value however if I use the variable in the if statement it only returns a blank cell.
If I use the IF statement and use "123" insteat of the variable it returns "123" as expected
I got it to work 🙂
I had to use a filter in my calculation.
Thank you for you help!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 62 | |
| 50 | |
| 45 |