Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Community,
I'm currently developing a project with the Power BI JavaScript Client and I've encountered an issue that I could use some assistance with.
To provide some context, I am working with a dataset that includes several tables. Among these tables, there's one titled "Product Daily Prices". This table has a column named "Price Date" which contains a "Date Hierarchy". This hierarchy includes levels for Year, Quarter, Month, and Day.
I have been attempting to utilize the Report Authoring SDK to append the "Year" hierarchy level with the following code:
await visual.addDataField('Category', {
table: 'Product Daily Prices',
hierarchy: 'Price Date',
hierarchyLevel: 'Year',
$schema: "http://powerbi.com/product/schema#hierarchyLevel",
});
I also tried to adjust the hierarchy parameter in my code to 'Date Hierarchy', to see if this was the cause of the issue:
await visual.addDataField('Category', {
table: 'Product Daily Prices',
hierarchy: 'Date Hierarchy',
hierarchyLevel: 'Year',
$schema: "http://powerbi.com/product/schema#hierarchyLevel",
});
However, both of these code snippets result in the same error:
{
"message": "FailedToAddDataField",
"detailedMessage": "Failed to add data field to role"
}
I have been unable to find the cause of this problem and would appreciate any guidance on resolving this. Has anyone else experienced this issue when attempting to add a hierarchy level to a data field with the Power BI JS Client?
Thanks in advance for your help.
Best regards,
Luis
Have encounter the same problem too, have you found the solution yet?
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 |
User | Count |
---|---|
9 | |
7 | |
5 | |
4 | |
4 |