Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
calculated column in import method =
Maxdate= CALCULATE(MAX(' Table1'[CommonDate]),FILTER('table1','table1'[ID]=EARLIER('table1'[ID])),FILTER(ALLSELECTED('table1'[created calulated category column]),'table1'[created calulated category column]="category1"|| ''table1'[created calulated category column]="category2"||'table1'[created calulated category column]="category3"))
Solved! Go to Solution.
hi, @Anonymous
For direct query model, there is no data be imported, so when add a calculate column, there is no row context, it is limited to being intra-row, as in, they can only refer to values of other columns of the same table, without the use of any aggregate functions.
Limitations in calculated columns: Calculated columns are limited to being intra-row, as in, they can only refer to values of other columns of the same table, without the use of any aggregate functions. Additionally, the DAX scalar functions (such as LEFT()) that are allowed, will be limited to those which can simply be pushed to the underlying source, hence will vary depending upon the exact capabilities of the source. Functions that are not supported will not be listed in autocomplete when authoring the DAX for a calculated column, and would result in an error if used.
https://docs.microsoft.com/en-us/power-bi/desktop-directquery-about
and you could use calculate measure instead of calculate column
Maxdate = CALCULATE ( MAX ( ' Table1'[CommonDate] ), ALLEXCEPT('table1','table1'[ID]), FILTER ( ALLSELECTED ( 'table1'[created calulated category column] ), 'table1'[created calulated category column] = "category1" || 'table1'[created calulated category column] = "category2" || 'table1'[created calulated category column] = "category3" ) )
exclusion of not max = if([Maxdate]=SELECTEDVALUE('table1'[Date]),SELECTEDVALUE('table1'[ID]),0)
or
exclusion of not max = if([Maxdate]=SELECTEDVALUE('table1'[Date]),SUM('table1'[ID]),0)
Best Regards,
Lin
hi, @Anonymous
For direct query model, there is no data be imported, so when add a calculate column, there is no row context, it is limited to being intra-row, as in, they can only refer to values of other columns of the same table, without the use of any aggregate functions.
Limitations in calculated columns: Calculated columns are limited to being intra-row, as in, they can only refer to values of other columns of the same table, without the use of any aggregate functions. Additionally, the DAX scalar functions (such as LEFT()) that are allowed, will be limited to those which can simply be pushed to the underlying source, hence will vary depending upon the exact capabilities of the source. Functions that are not supported will not be listed in autocomplete when authoring the DAX for a calculated column, and would result in an error if used.
https://docs.microsoft.com/en-us/power-bi/desktop-directquery-about
and you could use calculate measure instead of calculate column
Maxdate = CALCULATE ( MAX ( ' Table1'[CommonDate] ), ALLEXCEPT('table1','table1'[ID]), FILTER ( ALLSELECTED ( 'table1'[created calulated category column] ), 'table1'[created calulated category column] = "category1" || 'table1'[created calulated category column] = "category2" || 'table1'[created calulated category column] = "category3" ) )
exclusion of not max = if([Maxdate]=SELECTEDVALUE('table1'[Date]),SELECTEDVALUE('table1'[ID]),0)
or
exclusion of not max = if([Maxdate]=SELECTEDVALUE('table1'[Date]),SUM('table1'[ID]),0)
Best Regards,
Lin
User | Count |
---|---|
70 | |
70 | |
34 | |
23 | |
22 |
User | Count |
---|---|
96 | |
94 | |
50 | |
42 | |
40 |