The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all !
By using the matrix data mapping with the capabilities as below :
"dataRoles": [
{
"name": "timedimension",
"displayName": "Time Dimension",
"displayNameKey": "Visual_Category",
"kind": "Grouping"
},
{
"name": "dimension",
"displayName": "Dimension",
"displayNameKey": "Visual_Dimension",
"kind": "Grouping"
},
{
"name": "measure",
"displayName": "Measure",
"displayNameKey": "Visual_Values",
"kind": "Measure"
}
],
...
"dataViewMappings": [
{
"matrix": {
"rows": {
"for": {
"in": "timedimension"
},
"root": {
"children": [
{
"level": 0,
"value": "Year",
"children": [
{
"level": 1,
"value": "Quarter",
"children": [
{
"level": 2,
"value": "Month",
"children": [
{
"level": 3,
"value": "Day",
"values": {
"0": {
"value": "measure"
}
}
}
]
}
]
}
]
}
]
}
},
"columns": {
"root": {
"children": [
{
"level": 0,
"value": "dimension"
}
]
}
},
"values": {
"select": [
{
"bind": {
"to": "measure"
}
}
]
}
}
}
]
I am getting the values just for the leaves of my hierarchy as below :
But, I need to get the aggregation values for the parent members of the hierarchy (Month/Quarter/Year) .
Any comments & helps to figure it out is welcome !
Thanks in advance !
Hi @dm-p ! about this maybe you could catch a mistake or have an opinion ? You can find some more details at the post that i have replied here in same topic.. Thanks in Advance !
Hi @V-lianl-msft thanks for answering !
Well , the configuration i have shared is already done guiding by the documentation that you have shared.
I will make some highlights of the changes that I applied upon the reference to point out better the situation,
So in the documentation the last child of the "row" attribute which include the value properties:
"children": [
{
"level": 2,
...
"value": "Grandchild1",
"identity": {...},
"values": {
"0": {
"value": 5 // value for Col1
},
"1": {
"value": 6 // value for Col2
}
}
},
So , here the values (5,6) are placed in our case will be obtained from the "measure" data type, so it is mapped as :
"children": [
{
"level": 3,
"value": "Day",
"values": {
"0": {
"value": "measure"
}
}
}
]
and for the "columns" the "value" is changed as "dimension" in my configuration to get the value for each column name from "dimension" data type ,
documentation :
"columns": {
"levels": [...],
"root": {
...
"children": [
{
"level": 0,
"levelValues": [...],
"value": "Col1",
"identity": {...}
},
my configuration :
"columns": {
"for": {
"in": "dimension"
},
"root": {
"children": [
{
"level": 0,
"value": "dimension"
}
]
}
},
Here one last difference is that I have placed the for:in attribute (it is mandatory).
So, depending on this, if you have any specific suggestion please do not hesitate to share..
I will be looking forward for any answer, thanks in advance!
Hi @Anonymous ,
Please refer to the document:
https://docs.microsoft.com/en-us/power-bi/developer/visuals/dataview-mappings
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
15 | |
12 | |
3 | |
3 | |
2 |