Forum Discussion
Measure Not Working With Relationship?
Hi,
I have two tables.
First is the fact table with my transactions, in which I have the Customer Name and order intake.
Second is the dim table with Customer Name and Customer Segment, Customer Type.
There is a relationship between dim_Customer and fact_Install based on Customer Name. The relationship is many to one with a single cross filter direction.
There is also a calendar table because I have measures like:
Order-Intake-CY =
switch(SELECTEDVALUE(dim_Scenario[Scenario]),
"MTD",TOTALMTD([Order-Intake-Sum],'dim_Calendar'[Date]),
"QTD",TOTALQTD([Order-Intake-Sum],'dim_Calendar'[Date]),
"YTD",TOTALYTD([Order-Intake-Sum],'dim_Calendar'[Date]))
Order-Intake-Sum =
sum(fact_Install[Order Intake])
Current Output:
Desired Output (I have used the column from fact_Install table instead of measure, but I need a measure to show various scenarios MTD QTD YTD):
5 Replies
- amitchandakSuper User
Anonymous , I am assuming you have created a measure slicer. Remember in Time intelligence, if date is not selected on-page, the end date of ytd, mtd,qtd will end date of the calendar . So that can be an issue.
Power BI — YTD Questions — Time Intelligence 1–5
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
Power BI — QTD Questions — Time Intelligence 2–5
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
Power BI — MTD Questions — Time Intelligence 3–5
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e- AnonymousNot applicable
thank you for your reply. Yes, I do have a measure slicer in which users select a particular month and year. However, I still don't understand why my measure is not working.
I noticed that when I added a calculated column (lookup with customer name to get the customer segment) to my fact table, all visuals behave as expected... but why it is not working without these calculated columns, just based on the relationship?
- V-lianl-msftCommunity Support
Hi Anonymous ,
Try to add the Customer Name to the legend.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- V-lianl-msftCommunity Support
Hi Anonymous ,
This may cause by the context of the measure.
Based on your description, the relationship between the two tables is created based on the customer name, and the context used in the pie chart is Customer Segment?
There is no direct relationship between customer segment and order intake.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- AnonymousNot applicable
But the customer segment is part of the dim_Customer table and the order intake is part of fact_Install table.
So, if I have a dataset like mentioned on top - how can I show the order intake by customer segment?