alfranco17
Board Regular
- Joined
- Apr 14, 2013
- Messages
- 198
Hi.
I have a weird problem. If I add a measure to the values, it prevents me from selecting fields. If I add fields, Excel will not allow me to add the measure to values. And the weirdest thing is that it was working, and then said the original pivot table could not connect and became unusable. No errors in Power Query, Connections or Power Pivot. It is just when I try to add the measure with other fields that it happens. Other measure behave normally. DAX Studio says the measure works. It allows me to drop it to the values and then it does not appear.
We have some documents that apply by a date range to inventory stock and inventory transactions, and there is some overlap in the date ranges. The measure is supposed to show all documents that apply for a certain period.
This is the measure:
Thanks. I hope someone has gone through something similar and figured it out (so they can help me, not like I want everybody to struggle ).
Best regards.
I have a weird problem. If I add a measure to the values, it prevents me from selecting fields. If I add fields, Excel will not allow me to add the measure to values. And the weirdest thing is that it was working, and then said the original pivot table could not connect and became unusable. No errors in Power Query, Connections or Power Pivot. It is just when I try to add the measure with other fields that it happens. Other measure behave normally. DAX Studio says the measure works. It allows me to drop it to the values and then it does not appear.
We have some documents that apply by a date range to inventory stock and inventory transactions, and there is some overlap in the date ranges. The measure is supposed to show all documents that apply for a certain period.
This is the measure:
Code:
Documents :=VAR __start =
MIN ( Periods{Start Date] )
VAR __end =
MAX ( Periods[End Date] )
VAR _Part1 =
CALCULATE (
CONCATENATEX ( 'All Transactions','All Transactions'[Document],", "),
FILTER (
ALLEXCEPT ( 'All Transactions', Categories[Category], 'Reference'[Reference] ),
'All Transactions'{Start Date] < __end + 1
&& 'All Transactions'[End Date] >= __start
)
)
VAR _Part2 =
CALCULATE (
concatenatex ( AllStock, AllStock[Document],", " ),
FILTER (
ALLEXCEPT ( AllStock, Categories[Category], 'Reference'[Reference] ),
AllStock{Entry Date] < __end + 1
&& AllStock{Exit Date] >= __start
)
)
RETURN
IF(HASONEVALUE(Periods{Start Date]),IF(AND(_Part1<>"",_Part2<>""),_Part2&", " &_Part1, _Part2&_Part1),BLANK())
Thanks. I hope someone has gone through something similar and figured it out (so they can help me, not like I want everybody to struggle ).
Best regards.
Last edited: