Forum Discussion
Help with DAX on DirectQuery
Does the old ([date] + 7 * 1.) trick work? That would add 7 days to [date] for example.
I get this error when I'm trying to add following column in Calendar Table
Here is how "How Many Average Date?" measure is calculated in calendar table:
How many average days? = IF(HASONEVALUE('Days for Average'[Days]), MAX('Days for Average'[Days Value]), 30)
- parry2k9 years agoSuper User
Any help on this or alternate solution? Thanks!
- v-qiuyu-msft9 years agoCommunity Support
Hi parry2k,
From the error message, it indicates CountRows() cann't be used to create a calculated column in DirectQuery. Please check if 'Days for Average'[Days] or 'Days for Average'[Days Value] is calculated from the CountRows() function.
Depends on results you want to display in the visual, you can try to change the calculated column to a measure, as CountRows is available in measure.
Best Regards,
Qiuyun Yu
- parry2k9 years agoSuper User
Hi v-qiuyu-msft
As mentioned in my original post, my not using countrows anywhere and that was surprising to me as well when I get this countrows error message, let me know what other information I can provide.
- parry2k9 years agoSuper User
Also if i make following as a column in my calendar table and use this column in my calculation, all works well.
How many Average Days?" = if(HASONEVALUE(SlicerTable), VALUES(SlicerTable[Days]), 7)
changed to column as fixed value
How many average days? = 30