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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
GlenntB
New Member

ALLEXCEPT not returning values as expected

Hi,

 

I'm trying to create a measure that returns the total cost of all rows in a timesheet table in a given period. I created a date table that connects to the timesheet table (UrenOmzet) on the date of the rows. 

 

    SUMX(
        FILTER(
            ALLEXCEPT(UrenOmzet;'Date'[Date]);
            UrenOmzet[activiteit_oid] <> "0C31547C-BA9D-474B-87DD-F52F2825B31B" && UrenOmzet[activiteit_oid] <> "FDF01697-B35A-47AF-A91D-CFD4F2BA6C2E"
        );
        UrenOmzet[Uren- geschreven] * UrenOmzet[Kostprijs - per uur]
    )

For some reason the ALLEXCEPT function does not seem to work on the date value. Any ideas on what could be the problem here?

1 ACCEPTED SOLUTION
v-danhe-msft
Employee
Employee

Hi @GlenntB,

Based on my test, you could refer to below formula:

Sample data:

1.PNG

Create a measure:

b = CALCULATE(SUMX('Table1',[NUMBER]*[WEIGHTED]),
        FILTER(ALLEXCEPT('Table1','Table1'[Date]),
            [Item] <> "C" && Table1[WEIGHTED] <> 63))

Result:

1.PNG2.PNG

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
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

6 REPLIES 6
v-danhe-msft
Employee
Employee

Hi @GlenntB,

Based on my test, you could refer to below formula:

Sample data:

1.PNG

Create a measure:

b = CALCULATE(SUMX('Table1',[NUMBER]*[WEIGHTED]),
        FILTER(ALLEXCEPT('Table1','Table1'[Date]),
            [Item] <> "C" && Table1[WEIGHTED] <> 63))

Result:

1.PNG2.PNG

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

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

@GlenntB

 

ALLEXCEPT is meant to be used more a filter argument than as a table

 

try like this:

 

=
CALCULATE (
    SUMX (
        UrenOmzet,
        UrenOmzet[Uren- geschreven] * UrenOmzet[Kostprijs - per uur]
    ),
    ALLEXCEPT (
        UrenOmzet,
        Date
    ),
    NOT UrenOmzet[activiteit_oid]
        IN {
        "0C31547C-BA9D-474B-87DD-F52F2825B31B",
        "FDF01697-B35A-47AF-A91D-CFD4F2BA6C2E"
    }
)

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

This leaves me with the same problem. It seems as if the date table does not filter the dates in the UrenOmzet table whenever I filter the date table on year or month. I did mark my date table as a date table, but the hierarchy does not seem to work as expected. Is there a known solution to this problem?

Do you have an active relationship between the two tables ?

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Yes there is an active one(Date) to many(UrenOmzet) relationship

THe filter on date should stay, maybe you can share your pbix file

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.