Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello All,
I am trying to filter table values as below query using NewTable option in modeling tab.
Q1 = CALCULATETABLE(SUMMARIZE('Table','Table'[Col1],'Table'[Col2],'Table'[Col3],'Table'[Col4]','Table'[Col5]),FILTER('Table','Table'[Col1]="a"))
It gives me a perfect result as i expected in a table format.
likewise i have written 4 queries as i have the 4 conditions.
Instead of that i have tried to write all the conditions in single query as below.
Table = var Q1 = CALCULATETABLE(SUMMARIZE('Table','Table'[Col1],'Table'[Col2],'Table'[Col3],'Table'[Col4]','Table'[Col5]),FILTER('Table','Table'[Col1]="a")) var Q2 = CALCULATETABLE(SUMMARIZE('Table','Table'[Col1],'Table'[Col2],,'Table'[Col4]'),FILTER('Table','Table'[Col1]="b")) var Q3 = CALCULATETABLE(SUMMARIZE('Table','Table'[Col1],'Table'[Col3],'Table'[Col5]),FILTER('Table','Table'[Col1]="c")) var Q4 = Q1 = CALCULATETABLE(SUMMARIZE('Table','Table'[Col1],'Table'[Col3],'Table'[Col4]'),FILTER('Table','Table'[Col1]="d")) RETURN SWITCH( TRUE(), VALUES('Table'[A])="a",Q1, VALUES('Table'[A])="b",Q2, VALUES('Table'[A])="c",Q3, VALUES('Table'[A])="d",Q4, )
But it is giving me the error as
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
Can anyone please suggest me to get this done.
Thanks
MohanV
@Anonymous what is the results of the tables, post screen shots
Proud to be a Super User!
Thanks for the reply @vanessafvg.
Here is the sample table
Likewise i am able to get the values for another 3 conditions as mentioned in my question.
Can you please suggest me a way to get this done.
This is most probably a follow up on this thread in which I got involved.
From the followup questions (like this one), I start to suspect that 1 new table must be created with values from selected columns in the Source table (based on the value in a specific column)..
E.g. if the value in column A is ... then the required columns are:
Value "a": columns 1,2,3,4,5
Value "b": columns 1,2,4
Value "c": columns 1,3,5
Value "d": columns 1,3,4
empty: ???
But that is my interpretation, to be confirmed by @Anonymous
Yes it is @MarcelBeug, but i think the issue that i have mentioned her is something regarding Dax measure if i am not wrong.
And yes it should create a table based on the value in specific column.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |