Forum Discussion
Measures in Shared Datasets
Hello,
I am starting to explore utilising shared datasets in Power BI to aviod having to duplicate creating measures across multiple reports. One of the datasets I want to use requires a dates table to successfully calculate some of the measures I want. I have had to rename the dates table in the shared dataset and then create a relationship between that and my 'Dates' table in the new report. The 'Dates; table links to other tables so would not want to use the 'HC_Dates' table in the new report.
Is there a way to create the measures in the shared dataset that would mean the 'HC_Dates' table could be removed and I set up the relationships between the 'Dates' table and 'Headcount' table? Below is an example of the type of measure I have created in the shared dataset.
Current Month Budget =
var current_month =
CALCULATE(
SUM(Headcount[Value]),
FILTER(Headcount, Headcount[Type] = "Budget"),
USERELATIONSHIP('HC_Dates'[APv2], Headcount[Period AP])
)
return
IF(
ISBLANK(current_month),"n/a",current_month
)
3 Replies
- aj1973Community Champion
Hi Anonymous
Are you not able to connect your Dates table directly to Headcount table?
- AnonymousNot applicable
I have tried that but any measure that has been written in the Shared dataset returns blanks when used with a Dates table that is not part of that dataset. In the example above I adjusted the 'HC_dates' in the measure to 'Dates' and deleted the 'Dates' table from the shared dataset and set up the relationships to the 'Dates' table in the new report.
- aj1973Community Champion
In that case you will have to recreate your own measures with modifactions at the filters contexts. You can't make changes to the old ones because your Model is on Live connection.
Duplicating the measures won't hurt the performance of your report.