0
votes

Is it possible, in a DAX measure, to check if the current query contains a particular column?

For example, I have a column named "Time" - is it possible to detect if a user in a self service environment has included this in their report, from the measure?

Edit - adding example of an output

An example output would be below

+---------+---------+------+--------------+
|  Col1   |  Col2   | Col3 | ContainsCol3 |
+---------+---------+------+--------------+
| Value 1 | Value 2 |  123 | True         |
+---------+---------+------+--------------+

+---------+---------+------+--------------+
|  Col1   |  Col2   | Col4 | ContainsCol3 |
+---------+---------+------+--------------+
| Value 1 | Value 2 |  123 | False        |
+---------+---------+------+--------------+

The query containing Col3 returns true, the query that does not include col3 returns false.

1
What exactly is the use case?Foxan Ng
@FoxanNg conditionally summing a different source column depending on the column used from the time dimensionNeil P
is it only if the column is included on the rows/columns of the query/pivot?Bill Anton
might help to post some sample (pseudo) code to help give a clearer pictureBill Anton
@BillAnton see edit. I hope that makes sense, it's not easy to draw!Neil P

1 Answers

1
votes

not exactly, but you can use functions like ISCROSSFILTERED, ISFILTERED, HASONEFILTER, HASONEVALUE which might be sufficient depending on your end-goal.