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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
anandfarmers
Advocate I
Advocate I

ALLSELECTED() - data modelling issue

Hi All,

 

I have the below schema

anandfarmers_0-1706066667489.png

 

The DatePeriod can be Yesterday, This Week, This Month, etc. So a Date can be in multiple Date Periods. 

Date Period has Many to One relationship with DimDate.

 

If I use the DimDate date column as slicer and use ALLSELECTED in a measure to select Max Sales for the period, it works well.

 

anandfarmers_1-1706066869540.png

 

But if I remove the DimDate slicer and use the Date Period as a slicer and select This Week, which in turn should filter DimDate which in turn should filter FactInternetSales.

But in this scenario, the Max Sales is displayed for all the dates in DimDate.

Why is this?

 

anandfarmers_2-1706067071471.png

 

I can include a IF [_Sales Amount] > 0 check and restrict it to show only the required dates, but I ma trying to understad the ALLSELCTED behaviour in snowflake scema scenario.

 

Here is the measure I am using:

 

 

_Max Sales =
var _SalesSummary =
CALCULATETABLE(
    ADDCOLUMNS(
        SUMMARIZE(FactInternetSales, DimDate[FullDateAlternateKey])
        ,"@Amt" ,[_Sales Amount]
    )
    ,ALLSELECTED()
)

var _MaxSales =
MAXX(
    _SalesSummary
    ,[@Amt]
)
RETURN
    _MaxSales

 

 

 

I can't SUMMARIZE FactInterSales by DatePeriod table. I am assuming the relationship cannot traverse many to one, eventhough it is set to filter DimDate table. Is this the cause?

How can I solve this scenario in data modelling?

2 REPLIES 2
lbendlin
Super User
Super User

Date Period has Many to One relationship with DimDate.

yes, but the search filter goes both ways, making this rather ineffective.  Cut the link and use measures instead.

Thanks @lbendlin .

The users need to be able to filter by Date Period. e.g. This week, this month, etc. So they don't need to enter dates - that is the requirement.

I cannot use a measure as a Slicer.

 

 

 

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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