Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I need to calculate a division using values from 2 diffierent tables linked by relationship. The 2 tables are linked by 2 dimension tables: one is a date table and the other a client name table. The calculation is to show the number of Value/OrderNo. (average value per order of the same linked month and same client).
I created the following measure, but it didn't work:
Solved! Go to Solution.
Hi @Anonymous
To make expected visuals and reports, i would suggest you to create proper data models.
I make a test as below, please read though to see if it would help you.
I have three tables
"value table" with columns : client, month, year, department,value
"order table" with columns : client, month, year, department,order
"standardise client table" with columns : standardise name, invalid name
1.
First open Edit queries, merge "order table" and "value table" to a single table
1.1
merge column "standardise name" from "standardise client table" to"order table"
The same for "value table" , merge column"standardise name"from"standardise client table" to "value table".
1.2 merge columns in "order table"
Merge columns in "value table", the same as above,
Note: In two tables, click on each column on the same order as shown (1,2,3,4)
1.3 Merge two tables "order table" and "value table"
Select "merge queries"->merge as new
then expand "value" and "client" from "value table".
For a good performance when data is huge, you could right click on the table name and uncheck the "enable load"
Close&&apply
fianlly, create a a column in "Merge" table
year/month = [year]&"/"&[month]
Create a calendar table
calendar = FILTER( ADDCOLUMNS(CALENDAR(DATE(2018,1,1),DATE(2018,2,28)),"year/month",FORMAT([Date],"yyyy/m")),DAY([Date])=1)
You could connect this calendar table with "merge1" table with the column "year/month" in both tables.
Then you can add slicers on the report to filter the order/value or any other calculation based on these.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
I can make it work on my side.
On my side, two tables have relationships as below
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the idea of concatenating client and month/period. This is what I didn't have at the time. I used a test model with this concat and then it worked OK.
However, when I trie to use dimension tables for 'client' and 'month', and also 'year', then I couldn't not put two different tables columns in the ALLEXCEPT function. I think this is where it went wrong.
In the real dataset, client names in 2 data tables are not necessarily the same, so a dimension table is used to standardise client names. In fact, there are also other column parameters that I would like to use as a possible filter. Month/year is easier to deal with. I wonder if you have any suggestions if I want to use dimension tables as filters so the resulted chart could be more interactive? Thanks.
Hi @Anonymous
Is this problem sloved?
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please let me know.
Best Regards
Maggie
Hi, Maggie
Sorry for the late reply, was away. Thank you for taking the time to find and explain the solutions. I was thinking of something along the line but not as clean as your suggestion. Much appreciated.
Thanks,
Alex
Hi @Anonymous
To make expected visuals and reports, i would suggest you to create proper data models.
I make a test as below, please read though to see if it would help you.
I have three tables
"value table" with columns : client, month, year, department,value
"order table" with columns : client, month, year, department,order
"standardise client table" with columns : standardise name, invalid name
1.
First open Edit queries, merge "order table" and "value table" to a single table
1.1
merge column "standardise name" from "standardise client table" to"order table"
The same for "value table" , merge column"standardise name"from"standardise client table" to "value table".
1.2 merge columns in "order table"
Merge columns in "value table", the same as above,
Note: In two tables, click on each column on the same order as shown (1,2,3,4)
1.3 Merge two tables "order table" and "value table"
Select "merge queries"->merge as new
then expand "value" and "client" from "value table".
For a good performance when data is huge, you could right click on the table name and uncheck the "enable load"
Close&&apply
fianlly, create a a column in "Merge" table
year/month = [year]&"/"&[month]
Create a calendar table
calendar = FILTER( ADDCOLUMNS(CALENDAR(DATE(2018,1,1),DATE(2018,2,28)),"year/month",FORMAT([Date],"yyyy/m")),DAY([Date])=1)
You could connect this calendar table with "merge1" table with the column "year/month" in both tables.
Then you can add slicers on the report to filter the order/value or any other calculation based on these.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |