Forum Discussion
Date parameters are not filtering report
- 1 year ago
Hey mp390988,
Looking at your DAX query, I can see the issue. You're filtering on 'Calendar'[Date] but displaying 'TradesPlus'[TradeDate] - these are two different fields, and the relationship between them might not be working as expected in this context.
Solution Steps:
1. Direct Filter Approach Replace your current filter conditions with:
EVALUATE
CALCULATETABLE(
SUMMARIZECOLUMNS(
'TradesPlus'[TradeDate],
'TradesPlus'[ClientID],
'TradesPlus'[ClientName],
'TradesPlus'[BuyCCY],
'TradesPlus'[BuyAmount],
'TradesPlus'[SellCCY],
'TradesPlus'[SellAmount],
'TradesPlus'[GBPVolume],
'TradesPlus'[GBPRevenue]
),
'TradesPlus'[TradeDate] >= DATEVALUE(@FromCalendarDate),
'TradesPlus'[TradeDate] <= DATEVALUE(@ToCalendarDate)
)2. Alternative Using FILTER Function If you need to maintain the Calendar table relationship:
EVALUATE
FILTER(
SUMMARIZECOLUMNS(
'TradesPlus'[TradeDate],
'TradesPlus'[ClientID],
'TradesPlus'[ClientName],
'TradesPlus'[BuyCCY],
'TradesPlus'[BuyAmount],
'TradesPlus'[SellCCY],
'TradesPlus'[SellAmount],
'TradesPlus'[GBPVolume],
'TradesPlus'[GBPRevenue]
),
'TradesPlus'[TradeDate] >= DATEVALUE(@FromCalendarDate) &&
'TradesPlus'[TradeDate] <= DATEVALUE(@ToCalendarDate)
)3. Parameter Verification
- Check if your parameters are passing correct date values
- Verify the date format matches your regional settings
- Test with hardcoded dates first to isolate the issue
4. Relationship Check
- Confirm the relationship between Calendar and TradesPlus tables is active
- Ensure both date fields have the same data type
- Check if there are any inactive relationships affecting the filter context
The key issue is that SUMMARIZECOLUMNS with external filters on related tables can sometimes behave unexpectedly. Filtering directly on the fact table date field should resolve your problem.
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer
Hey mp390988,
Looking at your DAX query, I can see the issue. You're filtering on 'Calendar'[Date] but displaying 'TradesPlus'[TradeDate] - these are two different fields, and the relationship between them might not be working as expected in this context.
Solution Steps:
1. Direct Filter Approach Replace your current filter conditions with:
EVALUATE
CALCULATETABLE(
SUMMARIZECOLUMNS(
'TradesPlus'[TradeDate],
'TradesPlus'[ClientID],
'TradesPlus'[ClientName],
'TradesPlus'[BuyCCY],
'TradesPlus'[BuyAmount],
'TradesPlus'[SellCCY],
'TradesPlus'[SellAmount],
'TradesPlus'[GBPVolume],
'TradesPlus'[GBPRevenue]
),
'TradesPlus'[TradeDate] >= DATEVALUE(@FromCalendarDate),
'TradesPlus'[TradeDate] <= DATEVALUE(@ToCalendarDate)
)
2. Alternative Using FILTER Function If you need to maintain the Calendar table relationship:
EVALUATE
FILTER(
SUMMARIZECOLUMNS(
'TradesPlus'[TradeDate],
'TradesPlus'[ClientID],
'TradesPlus'[ClientName],
'TradesPlus'[BuyCCY],
'TradesPlus'[BuyAmount],
'TradesPlus'[SellCCY],
'TradesPlus'[SellAmount],
'TradesPlus'[GBPVolume],
'TradesPlus'[GBPRevenue]
),
'TradesPlus'[TradeDate] >= DATEVALUE(@FromCalendarDate) &&
'TradesPlus'[TradeDate] <= DATEVALUE(@ToCalendarDate)
)
3. Parameter Verification
- Check if your parameters are passing correct date values
- Verify the date format matches your regional settings
- Test with hardcoded dates first to isolate the issue
4. Relationship Check
- Confirm the relationship between Calendar and TradesPlus tables is active
- Ensure both date fields have the same data type
- Check if there are any inactive relationships affecting the filter context
The key issue is that SUMMARIZECOLUMNS with external filters on related tables can sometimes behave unexpectedly. Filtering directly on the fact table date field should resolve your problem.
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer