Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

Date Range Filter

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?

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

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:

3.JPG

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:

5.JPG

 

here is pbix file that Relationship between fact and Vendor exists with direction of 'Both', please try it.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

 

here is pbix file that Relationship between fact and Vendor exists with direction of 'Single', please try it.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lili6-msft
Community Support
Community Support

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:

3.JPG

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:

5.JPG

 

here is pbix file that Relationship between fact and Vendor exists with direction of 'Both', please try it.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.