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.
Hi,
I am trying to filter one factTable with a variable table of another filtered factTable.
Problem is IN VALUES doesnt accept a vTable.
I have tried INTERSECT but not really sure how to complete it with that.
The goal is to SUM up all timestampes in
FactWorkShopStampings[StampedTime]
where
FactWorkShopStampings[OrderNumber]
This is what I tried
WeekRpt - UnInvoiced - Stamped Time_Single =
VAR _LastTransferDate = MAX( FactUnInvoicedWorkShopOrderRow[EventDate] )
VAR __TempTable =
CALCULATETABLE(
SELECTCOLUMNS( FactUnInvoicedWorkShopOrderRow,
"COSTCENTER", LOOKUPVALUE( CostCenter[CosterCenterIDShort], CostCenter[Department_KEY], FactUnInvoicedWorkShopOrderRow[Department_KEY] ),
"ORDERNUMBER", FactUnInvoicedWorkShopOrderRow[OrderNumber],
"EVENTDATE", FactUnInvoicedWorkShopOrderRow[EventDate]
),
FILTER(
FactUnInvoicedWorkShopOrderRow ,
FactUnInvoicedWorkShopOrderRow[EventDate] = _LastTransferDate
)
)
VAR __TempTableGroupBy =
GROUPBY (
__TempTable,
[COSTCENTER],
[ORDERNUMBER],
[EVENTDATE]
)
VAR _SumStapedTime =
CALCULATE (
SUM( FactWorkShopStampings[StampedTime] ),
FILTER ( ALL( FactWorkShopStampings ) ,
FactWorkShopStampings[OrderNumber] IN VALUES( __TempTableGroupBy[ORDERNUMBER] )
)
)
RETURN
_SumStapedTime
Hi @kmansweden ,
You can update the formula of measure [WeekRpt - UnInvoiced - Stamped Time_Single] as below and check if it can return the expected result...
WeekRpt - UnInvoiced - Stamped Time_Single =
VAR _LastTransferDate =
MAX ( FactUnInvoicedWorkShopOrderRow[EventDate] )
VAR __TempTable =
CALCULATETABLE (
VALUES ( FactUnInvoicedWorkShopOrderRow[OrderNumber] ),
FILTER (
FactUnInvoicedWorkShopOrderRow,
FactUnInvoicedWorkShopOrderRow[EventDate] = _LastTransferDate
)
)
VAR _SumStapedTime =
CALCULATE (
SUM ( FactWorkShopStampings[StampedTime] ),
FILTER (
ALL ( FactWorkShopStampings ),
FactWorkShopStampings[OrderNumber] IN __TempTable
)
)
RETURN
_SumStapedTime
Best Regards
User | Count |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |