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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
styxbe
Regular Visitor

Understanding calculate and slicer behaviour

Hi,
I am new to PowerBI/DAX but (think) I have a decent understanding of the basics. I run into behaviour I don't understand though:
So with very simple sample data:

styxbe_0-1711619963671.png

I want to display the last date for [model] before the current date. The current date is selected with a slicer:

styxbe_1-1711620070637.png


The measure is set up like this:

 

Previous Occurence = 
    VAR selecteddate = SELECTEDVALUE(Data[Date])
    RETURN
    CALCULATE(
        MAX(Data[Date]),
        FILTER(
            ALL(Data[Date]),
            Data[Date]<selecteddate
        )
    )

 

 
I would expect ALL to remove all filters from [Date], but the slicer still seems to be applied. In above screenshot I would expect model A50003 to shop up with date 08/01/2024, but it is blank because the model was not present for the date selected in the slicer.

When I use a separate date table without relationship, it does work like expected:

styxbe_2-1711620371653.png


Would like to understand why this is happening and whether I can achieve this without a separate table.

Thanks!

1 ACCEPTED SOLUTION
Zang_Mi
Resolver II
Resolver II

Hello, I will say it is not possible achieving the desired result without a separate table (for slicer), since the data field used a row and dates are from the same table, for this reason, when a model is not present on the day selected, it will not be displayed in the visual.

View solution in original post

1 REPLY 1
Zang_Mi
Resolver II
Resolver II

Hello, I will say it is not possible achieving the desired result without a separate table (for slicer), since the data field used a row and dates are from the same table, for this reason, when a model is not present on the day selected, it will not be displayed in the visual.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.