Forum Discussion
Create measure from multiple related table (3 table's involved)
Hi,
>> How can I create a measure at the SubscriptionVersionTable: that will give me ProductInstandeUsage[TotalMB’s], by given period from Time[PK_Date], by selecting SubscriptionVersion[SubscriptionProductId]
According to your description, you want to get the sum of ProductInstandeUsage[TotalMB’s] based on choosed “Time[PK_Date]” and “SubscriptionVersion[SubscriptionProductId]”, right?
You can refer to below measure to get the specify sum of ProductInstandeUsage[TotalMBs]:
Sum of Specify SubscriptionID and Date = CALCULATE(SUM(ProductInstanceUsage[Sum of TotalMBs]), FILTER(ProductInstanceUsage,ProductInstanceUsage[SubscripitonID]= if(HASONEVALUE(SubscriptionVersion[SubscriptionID]),LASTNONBLANK(SubscriptionVersion[SubscriptionID],SubscriptionVersion[SubscriptionID]),BLANK())&&ProductInstanceUsage[Date]=if(HASONEVALUE(DateTable[Date]),MAX(DateTable[Date]),BLANK())))
Slicers:
Result:
Notice: this measure only works when you choose one item.
Regards,
Xiaoxin Sheng
Hi Xiaoxin,
I used the measure in Power BI, see below.
SumTotalMBsUsage = CALCULATE(SUM(ProductInstanceUsage[TotalMBs]); FILTER(ProductInstanceUsage;ProductInstanceUsage[SubscriptionID]= if(HASONEVALUE(SubscriptionVersion[SubscriptionID]);LASTNONBLANK(SubscriptionVersion[SubscriptionID];SubscriptionVersion[SubscriptionID]);BLANK())&&ProductInstanceUsage[Date]=if(HASONEVALUE('Date'[Date]);MAX('Date'[Date]);BLANK())))
I got data by selecting "MainVoiceProduct" = 114, and "SubscrtiptionID" = 1114, for 4 dates in the Timetable. It seems like
I get the sum of "TotalMBs" where for the SubscriptionVersion[SubscriptionID] <> ProductInstanceUsage[SubscriptionID]
It should be the otherway around where SubscriptionVersion[SubscriptionID] = ProductInstanceUsage[SubscriptionID].
So the output should be 8.14 instead of 2512.87