Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All,
Hope you can help. I am trying to understand a DAX query that has been developed so that I can maniuplate. Below is a copy of the query:
ValueCOL =
CALCULATE(
CALCULATE(MAX(Table 1[Value]),
FILTER(Table1,
IF(ISFILTERED('Table P'[P Level 2]),
Table 1[FChannel] IN VALUES('TableC'[FChannel])
&& Table1[P Level 1] IN VALUES('TableP'[P Level 1])
&& Table1[P Level 2] IN VALUES('TableP'[P Level 2]),
IF(ISFILTERED('Table P'[P Level 1]),
Table 1[F Channel] IN VALUES('Table C'[F Channel])
&& Table 1 [P Level 1] IN VALUES('Table P'[P Level 1]),
IF(ISFILTERED('Table C'[FChannel]),Table 1[ FChannel] IN VALUES('Table C'[F Channel]), MAX(Table 1[Value])))))))
Any help appreciated.
Solved! Go to Solution.
@Anonymous
ValueCOL =
CALCULATE (
CALCULATE (
// finding the max value in Value column
MAX ( 'Table1'[Value] ),
// filtering the Table1
FILTER (
'Table1',
// If the column P Level 2 is filtered then FChannel in Table1 = FChannel in TableC and next condition
IF (
ISFILTERED ( 'Table P'[P Level 2] ),
'Table1'[FChannel]
IN VALUES ( 'TableC'[FChannel] )
&& 'Table1'[P Level 1]
IN VALUES ( 'TableP'[P Level 1] )
&& 'Table1'[P Level 2]
IN VALUES ( 'TableP'[P Level 2] ),
// else applying another filter condition
IF (
ISFILTERED ( 'Table P'[P Level 1] ),
'Table1'[F Channel]
IN VALUES ( 'Table C'[F Channel] )
&& 'Table1'[P Level 1]
IN VALUES ( 'Table P'[P Level 1] ),
//else another
IF (
ISFILTERED ( 'Table C'[FChannel] ),
'Table1'[ FChannel]
IN VALUES ( 'Table C'[F Channel] ),
MAX ( 'Table1'[Value] )
)
)
)
)
)
)
https://docs.microsoft.com/en-us/dax/if-function-dax
https://docs.microsoft.com/en-us/dax/filter-functions-dax
https://docs.microsoft.com/en-us/dax/isfiltered-function-dax
https://docs.microsoft.com/en-us/dax/values-function-dax
https://docs.microsoft.com/en-us/dax/in-operator-containsrow-function
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
@Anonymous
ValueCOL =
CALCULATE (
CALCULATE (
// finding the max value in Value column
MAX ( 'Table1'[Value] ),
// filtering the Table1
FILTER (
'Table1',
// If the column P Level 2 is filtered then FChannel in Table1 = FChannel in TableC and next condition
IF (
ISFILTERED ( 'Table P'[P Level 2] ),
'Table1'[FChannel]
IN VALUES ( 'TableC'[FChannel] )
&& 'Table1'[P Level 1]
IN VALUES ( 'TableP'[P Level 1] )
&& 'Table1'[P Level 2]
IN VALUES ( 'TableP'[P Level 2] ),
// else applying another filter condition
IF (
ISFILTERED ( 'Table P'[P Level 1] ),
'Table1'[F Channel]
IN VALUES ( 'Table C'[F Channel] )
&& 'Table1'[P Level 1]
IN VALUES ( 'Table P'[P Level 1] ),
//else another
IF (
ISFILTERED ( 'Table C'[FChannel] ),
'Table1'[ FChannel]
IN VALUES ( 'Table C'[F Channel] ),
MAX ( 'Table1'[Value] )
)
)
)
)
)
)
https://docs.microsoft.com/en-us/dax/if-function-dax
https://docs.microsoft.com/en-us/dax/filter-functions-dax
https://docs.microsoft.com/en-us/dax/isfiltered-function-dax
https://docs.microsoft.com/en-us/dax/values-function-dax
https://docs.microsoft.com/en-us/dax/in-operator-containsrow-function
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
8 |