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

View all the Fabric Data Days sessions on demand. View schedule

Reply
eliasayyy
Memorable Member
Memorable Member

Show Data from date range from 2 date tables with no relationships

hey everyone, im trying to build a dahsboard with a filter page like this

eliasayyy_0-1759907836448.png



start of week is from a dimdate table called Startdate

end of week is from another dimdate table called enddate

i also have my main dimdate table that has a relationship with my fact table

eliasayyy_5-1759908273351.png

 

 

 

eliasayyy_1-1759907904089.png



in this page, i have a chart, this chart is a measure from my fact table a simple sum([facttable[value]) in the y axis and x axis is day name from my main dimdate table

i did this measure

Measure in the Date Selected = 
VAR _start = MIN(StartDate[Date])
var _end = MAX(EndDate[Date])
RETURN
CALCULATE(
    [My Measure],
    REMOVEFILTERS(dimDate),
    filter(dimDate, AND(MIN(dimDate[Date]) >= _start, MAX(dimDate[Date]) <= _end)
    )
)


if i put the measure in a card, i get blank, if i put the measure with any column in my dimdate table, i get blank, however if i put the dimdate[date] column with my measure, it works, the dimdate[date] column must be included for my measure to work, i need to display the measure i na card and show the data by day name but they show blank

eliasayyy_2-1759908132484.png



now here is if i remove the dimdate[date] column

eliasayyy_3-1759908164772.png


any help would be appreciated











1 ACCEPTED SOLUTION
GrowthNatives
Solution Specialist
Solution Specialist

Hi @eliasayyy , you can follow these steps to get your required solution 

1. Keep only one active relationship: dimDate[Date] → Fact[DateKey].
  StartDate and EndDate tables must be disconnected (no relationships to anything). Use them only for slicers.

2.  Axis/rows: fields from dimDate (e.g., dimDate[DayName], dimDate[Date]).
  Never put StartDate/EndDate columns on the visual.

3. Replace your DAX 

Measure in Selected Range :=
VAR _start = MIN ( StartDate[Date] )
VAR _end   = MAX ( EndDate[Date] )
RETURN
IF (
    NOT ISBLANK ( _start ) &&
    NOT ISBLANK ( _end ) &&
    _start <= _end,
    CALCULATE (
        [My Measure],                         -- e.g. SUM(Fact[value])
        KEEPFILTERS ( dimDate[Date] >= _start ),
        KEEPFILTERS ( dimDate[Date] <= _end )
    )
)


KEEPFILTERS preserves the visual’s dimDate[DayName] context.
Filtering the column (dimDate[Date] >= _start / <= _end) avoids the dependency on having dimDate[Date] in the visual.


Hope this solution helps you make the most of Power BI! If it did, click 'Mark as Solution' to help others find the right answers.
💡Found it helpful? Show some love with kudos 👍 as your support keeps our community thriving!
🚀Let’s keep building smarter, data-driven solutions together!🚀  [Explore More]



View solution in original post

1 REPLY 1
GrowthNatives
Solution Specialist
Solution Specialist

Hi @eliasayyy , you can follow these steps to get your required solution 

1. Keep only one active relationship: dimDate[Date] → Fact[DateKey].
  StartDate and EndDate tables must be disconnected (no relationships to anything). Use them only for slicers.

2.  Axis/rows: fields from dimDate (e.g., dimDate[DayName], dimDate[Date]).
  Never put StartDate/EndDate columns on the visual.

3. Replace your DAX 

Measure in Selected Range :=
VAR _start = MIN ( StartDate[Date] )
VAR _end   = MAX ( EndDate[Date] )
RETURN
IF (
    NOT ISBLANK ( _start ) &&
    NOT ISBLANK ( _end ) &&
    _start <= _end,
    CALCULATE (
        [My Measure],                         -- e.g. SUM(Fact[value])
        KEEPFILTERS ( dimDate[Date] >= _start ),
        KEEPFILTERS ( dimDate[Date] <= _end )
    )
)


KEEPFILTERS preserves the visual’s dimDate[DayName] context.
Filtering the column (dimDate[Date] >= _start / <= _end) avoids the dependency on having dimDate[Date] in the visual.


Hope this solution helps you make the most of Power BI! If it did, click 'Mark as Solution' to help others find the right answers.
💡Found it helpful? Show some love with kudos 👍 as your support keeps our community thriving!
🚀Let’s keep building smarter, data-driven solutions together!🚀  [Explore More]



Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors