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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I'm using this measure in PBI desktop which works fine:
m_lan= sumx(values('vAbc'[ProjectID]),calculate(DISTINCTCOUNT('vAbc'[ID])))))
But I need to add two conditions and tried to change m_lan as below but getting this error: The following syntax error occurred during parsing: Invalid token, Line 3, Offset 3, .
New measure(with line number):
1 m_lan =
2 var lan =CALCULATE(
3 DISTINCTCOUNT('vAbc'[ID]),
4 FILTER('vAbc',
5 'vAbc'[col1] <> "Hello" &&
6 NOT(ISBLANK('vAbc'[col1]))
7 )
8 )
9
10 return SUMX(VALUES('vAbc'[ProjectID]), lan)
I've tried to rewrite the measure in many ways but still getting error or wrong result. How can I add those conditions to the original measure? or why I getting this error?
Solved! Go to Solution.
m_lan =
SUMX(
VALUES('vAbc'[ProjectID]),
CALCULATE(
DISTINCTCOUNT('vAbc'[ID]),
FILTER(
All('vAbc'[col1]),
'vAbc'[col1] <> "Hello" &&
NOT iSBLANK( 'vAbc'[col1] )
)
)
Have you tried something like this?
m_lan= CALCULATE(
sumx(values('vAbc'[ProjectID]),calculate(DISTINCTCOUNT('vAbc'[ID])))
,'vAbc'[col1] <> "Hello"
,NOT(ISBLANK('vAbc'[col1]))
)
Thank you for your suggestion. I changed measure but it shows the same value for all rows.
yes. was wondering what the sumx was for. But you might have to share more on the data you have and the output you are trying to achieve here.
@Trodo7377 Try this:
m_lan =
SUMX(
VALUES('vAbc'[ProjectID]),
CALCULATE(
DISTINCTCOUNT('vAbc'[ID]),
'vAbc'[col1] <> "Hello",
NOT(ISBLANK('vAbc'[col1]))
)
)
It's a little different
BBF
m_lan =
SUMX(
VALUES('vAbc'[ProjectID]),
CALCULATE(
DISTINCTCOUNT('vAbc'[ID]),
FILTER(
All('vAbc'[col1]),
'vAbc'[col1] <> "Hello" &&
NOT iSBLANK( 'vAbc'[col1] )
)
)
Thank you, it worked!🙂
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 7 | |
| 7 | |
| 6 |