The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I'm having a strange issue with my column legend.
In my data model (SSAS tabular model) I have a Dimension table which joins to the main fact table via a primary key (one to many, single direction).
This Dim table only has two fields:
ID (which is hidden in the model)
Status (the label)
If I use the ID field as the column legend, I get the correct values in the chart:
However, just changing this to the other field seems to split the values evenly:
Can anyone shed any light on why this is happening when both fields are in the same dim table?
Thanks
Hi @khampton ,
Since you have chosen a different column as the Legend of the column chart, the values displayed on the visual object will also change. As to whether the displayed result is correct, you may need to provide some example data
(exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
So I think it might actually be due to my DAX but I can't understand it as I'm just using the other field from the dim table to filter but it seems to work only for the ID field. I've created a very simplified version below.
Data Model:
DAX and charts showing what I have vs what I expect:
Hi @khampton ,
I still not clear about your requirement. What's your expected result? Could you please share a simplified pbix file (exclude sensitive data) with us for the further investigation? You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Unfortunately I'm not a superuser nor do I have a dropbox or public onedrive so I can't attach a pbix.
Regarding what I would expect to see, I would expect the chart legend to have the same split regardless of which field in the Dim Table I'm using, StatusID is the relationship between the tables and Status is the label value I want applied. However If I use Status as the column legend, it includes all values equally instead of only the two filtered out.
The Dim table is:
My Measure is: CALCULATE( SUM(Orders[Revenue]), 'Status'[Status] IN {"A","C"} , ...)
Therefore I expect A and C to be filtered out, but as you can see in my example if I use StatusID in the visualisation pane, it correctly applies 1 and 3 in correct proportions but if I use Status from the same table, it removed the filter and equally splits the column between all of the statuses.
Hi @khampton ,
Please update the formula of measure as below and check if it can return the expected result... You can find the details in the attachment.
Measure =
CALCULATE (
SUM ( 'Orders'[Revenue] ),
FILTER ( 'Status', 'Status'[Status] IN { "A", "C" } )
)
Best Regards
User | Count |
---|---|
69 | |
66 | |
62 | |
48 | |
28 |
User | Count |
---|---|
112 | |
81 | |
66 | |
54 | |
43 |