This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Subject is the base table which contain unique subject names. This tabel is connected to different tables like "_common_ae_sif_signature_state", "_common_edc_query_status", "_common_form_raw". Now I want to get the distinct count of subject numbers based on the specified conditions. Can you help?
I have written:
hi @SDVN ,
Why RELATED() isn’t working: The RELATED function only works in calculated columns, and only when there’s a direct one-to-many relationship from your base table to the related table. If you’re trying to do this in a measure, or if your tables are joined many-to-many (or via an indirect relationship), RELATED can’t be used.
What you can do instead:
For direct lookups:
Use LOOKUPVALUE in your measure. Example: StatusValue = LOOKUPVALUE(
RelatedTable[Status],
RelatedTable[Key], BaseTable[Key]
)
If your logic gets too complex, sometimes it’s easier to merge/join tables in Power Query first, so you only have to deal with a single table in your DAX. If you can share a small sample pbix file or a screenshot of your data model (with dummy data), I’m happy to take a look and help tweak the measure to your exact scenario!
Again the error 😞
"Too many arguments were passed to the OR function. The maximum argument count for the function is 2."
RELATED requires a row context, which you don't have in this calculation.
For this calculation you only need to place the filters on the required columns, so you can use
MEASURE =
CALCULATE (
DISTINCTCOUNT ( Subject[subject_number] ),
_common_ae_sif_signature_state[form_signed] = "No"
|| _common_casebook_signature_lock[cb_locked] = "No"
|| _common_edc_query_status[query_state_name]
IN { "Open", "Answered" }
|| _common_form_raw[sdvcompletestate] = "No"
&& _common_form_raw[hassdvrequireditems] = "Yes"
)
I got this error sir, "The expression contains columns from multiple tables, but only columns from a single table can be used in a True/False expression that is used as a table filter expression."
@SDVN , Try using this alternative approach
Measure =
CALCULATE(
DISTINCTCOUNT(Subject[subject_number]),
FILTER(
RELATEDTABLE(_common_ae_sif_signature_state),
_common_ae_sif_signature_state[form_signed] = "No"
) ||
FILTER(
RELATEDTABLE(_common_casebook_signature_lock),
_common_casebook_signature_lock[cb_locked] = "No"
) ||
FILTER(
RELATEDTABLE(_common_edc_query_status),
_common_edc_query_status[query_state_name] IN {"Open", "Answered"}
) ||
FILTER(
RELATEDTABLE(_common_form_raw),
_common_form_raw[sdvcompletestate] = "No" && _common_form_raw[hassdvrequireditems] = "Yes"
)
)
Proud to be a Super User! |
|
I got the error again!
"A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 28 | |
| 23 | |
| 22 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 60 | |
| 35 | |
| 28 | |
| 22 | |
| 21 |