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.
Fact is populated with DateKey and Vendor Key for every submission of data file.
Example:
fctSales
fctsk DateKey VendorKey Measure1 Measure2
1 20010101 101 122 555
2 20010109 102 522 565
3 20010111 101 122 555
4 20010112 103 592 123
dimVendor
VendorKey VendorName
101 Vendor 101
102 Vendor 102
103 Vendor 103
104 Vendor 104
I want to create report to with date range filter to see which vendor has submitted data file between those dates.
Example if my selection dates are 20010101 to 20010112
First Dataset: should list Vendor 101, 102, 103 as data submitted
Second Dataset: should list Vendor 104 as data NOT submitted
Relationship between fact and Vendor exists with direction of 'Both' and
Relationship between fact and Date exists with director of many to one.
What is the best way to acheive this?
Solved! Go to Solution.
hi, @Anonymous
After my research, you could try these two way as below:
1. for Relationship between fact and Vendor exists with direction of 'Both'
If you filter fctSales table, dimVendor will be filtered too, so you need a new dimVendor table and do not create a relationship with fctSales table.
Step1:
Create a new table by this formula
new dimVendor = dimVendor
Step2:
create a measure by this formula
NOT submitted = var _exsitVendorkey =VALUES(dimVendor[VendorKey]) return CALCULATE(MAX('new dimVendor'[VendorName]),FILTER('new dimVendor',NOT( 'new dimVendor'[VendorKey]) IN _exsitVendorkey ))
Step3:
Drag VendorKey and VendorName from dimVendor table as Submitted Vendor
Drag VendorKey and VendorName and measure NOT submitted from new dimVendor table as Not Submitted Vendor
Result:
2. If you set Relationship between fact and Vendor exists with direction of 'Single'
When you filter fctSales table, dimVendor will be not filtered.
So you could try this way:
Create two measure
submitted = var _exsitVendorkey =VALUES(fctSales[VendorKey]) return CALCULATE(MAX('dimVendor'[VendorName]),FILTER('dimVendor','dimVendor'[VendorKey] IN _exsitVendorkey ))
Not submitted = var _exsitVendorkey =VALUES(fctSales[VendorKey]) return CALCULATE(MAX('dimVendor'[VendorName]),FILTER('dimVendor',NOT('dimVendor'[VendorKey]) IN _exsitVendorkey ))
Then Drag VendorKey and VendorName and two measure from dimVendor table
Result:
here is pbix file that Relationship between fact and Vendor exists with direction of 'Both', please try it.
Best Regards,
Lin
hi, @Anonymous
here is pbix file that Relationship between fact and Vendor exists with direction of 'Single', please try it.
Best Regards,
Lin
hi, @Anonymous
After my research, you could try these two way as below:
1. for Relationship between fact and Vendor exists with direction of 'Both'
If you filter fctSales table, dimVendor will be filtered too, so you need a new dimVendor table and do not create a relationship with fctSales table.
Step1:
Create a new table by this formula
new dimVendor = dimVendor
Step2:
create a measure by this formula
NOT submitted = var _exsitVendorkey =VALUES(dimVendor[VendorKey]) return CALCULATE(MAX('new dimVendor'[VendorName]),FILTER('new dimVendor',NOT( 'new dimVendor'[VendorKey]) IN _exsitVendorkey ))
Step3:
Drag VendorKey and VendorName from dimVendor table as Submitted Vendor
Drag VendorKey and VendorName and measure NOT submitted from new dimVendor table as Not Submitted Vendor
Result:
2. If you set Relationship between fact and Vendor exists with direction of 'Single'
When you filter fctSales table, dimVendor will be not filtered.
So you could try this way:
Create two measure
submitted = var _exsitVendorkey =VALUES(fctSales[VendorKey]) return CALCULATE(MAX('dimVendor'[VendorName]),FILTER('dimVendor','dimVendor'[VendorKey] IN _exsitVendorkey ))
Not submitted = var _exsitVendorkey =VALUES(fctSales[VendorKey]) return CALCULATE(MAX('dimVendor'[VendorName]),FILTER('dimVendor',NOT('dimVendor'[VendorKey]) IN _exsitVendorkey ))
Then Drag VendorKey and VendorName and two measure from dimVendor table
Result:
here is pbix file that Relationship between fact and Vendor exists with direction of 'Both', please try it.
Best Regards,
Lin
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |