The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I've got this DAX that produces the correct result for the total quantity from 3 months previous. However, when I drag Transaction Type into my table, I still get that total result, but I was expecting to now see that total carved up by Transaction Type. What do I modify to get this to behave appropriately?
Ordered Qty Prev 3 Months Total TEST =
VAR __PREV_MONTH =
EOMONTH (
MAX ( 'Supply_Chain Orders'[Ship Date] ),
-1
)
VAR __PREV_MONTH3 =
EOMONTH (
MAX ( 'Supply_Chain Orders'[Ship Date] ),
-4
)
RETURN
CALCULATE (
SUM ( 'Supply_Chain Orders'[Ordered Quantity] ),
FILTER (
ALL ( 'Supply_Chain Orders' ),
'Supply_Chain Orders'[Ship Date].[Date] > __PREV_MONTH3
&& 'Supply_Chain Orders'[Ship Date].[Date] <= __PREV_MONTH
)
)
Solved! Go to Solution.
@Anonymous
Can you try this :
Ordered Qty Prev 3 Months Total TEST =
VAR __PREV_MONTH =
EOMONTH ( MAX ( 'Supply_Chain Orders'[Ship Date] ), -1 )
VAR __PREV_MONTH3 =
EOMONTH ( MAX ( 'Supply_Chain Orders'[Ship Date] ), -4 )
RETURN
CALCULATE (
SUM ( 'Supply_Chain Orders'[Ordered Quantity] ),
FILTER (
ALL ( 'Supply_Chain Orders'[Ship Date].[Date] ),
'Supply_Chain Orders'[Ship Date].[Date] > __PREV_MONTH3
&& 'Supply_Chain Orders'[Ship Date].[Date] <= __PREV_MONTH
)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks! ALL function had to be on specific column, not on whole table.
@Anonymous
Can you try this :
Ordered Qty Prev 3 Months Total TEST =
VAR __PREV_MONTH =
EOMONTH ( MAX ( 'Supply_Chain Orders'[Ship Date] ), -1 )
VAR __PREV_MONTH3 =
EOMONTH ( MAX ( 'Supply_Chain Orders'[Ship Date] ), -4 )
RETURN
CALCULATE (
SUM ( 'Supply_Chain Orders'[Ordered Quantity] ),
FILTER (
ALL ( 'Supply_Chain Orders'[Ship Date].[Date] ),
'Supply_Chain Orders'[Ship Date].[Date] > __PREV_MONTH3
&& 'Supply_Chain Orders'[Ship Date].[Date] <= __PREV_MONTH
)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group