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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MostafaGamal
Helper V
Helper V

slicer date not working properly in sum measure

Hi all, I have a table that contain mutiple rows for every user (mail) and to calculate the percentage of participation i want to count the no. of Entries for every user but this value should not exceed " 2 " so i create the following measure to count the no. of Entries for every ueser in the first 2 rows ( 1 entry = 1 row ) in a selected range of date by a slicer 

 

 

BOS # = 
VAR tab =
    SUMMARIZE (
        Sheet1,
        Sheet1[EntriesTime].[Date],
        Sheet1[Index],
        Sheet1[EntriesCount ],Sheet1[Mail],
        "count", CALCULATE (
            COUNT ( Sheet1[Mail] ),
            FILTER (
                ALLEXCEPT ( Sheet1, Sheet1[Mail] ),
                'Sheet1'[Index] <= MAX ( 'Sheet1'[Index] )
            )
        )
    )
RETURN
    SUMX ( FILTER ( tab, [count] <= 2 ), [EntriesCount ] ) 

 

 

and it works fine but when i change the range of date in the slicer the value i got from the meaure is " blank " ( the measure works fine when i choose the range date in July when i choose the range date august it gives my blank ) 

 

Please advise how to slove this issue ?? 

 

here is an example of the data i expect from the meaure 

 

Capture.PNG

 

here is a sample of the data i use in my table 

 

IndexDepartmentLineNameMailEntriesCount EntriesTime
1HSE Mostafa Gamalmetwaly.mg@pg.com17/1/2020
3HSE Mostafa Gamalmetwaly.mg@pg.com17/14/2020
4HSE Mostafa Gamalmetwaly.mg@pg.com17/15/2020
5HSE Mostafa Gamalmetwaly.mg@pg.com17/16/2020
6HSE Mostafa Gamalmetwaly.mg@pg.com17/17/2020
7HSE Abdullrahman Barakat ali.ab.1@pg.com17/13/2020
8HSE Abdullrahman Barakat ali.ab.1@pg.com07/16/2020
9HSE Abdullrahman Barakat ali.ab.1@pg.com07/17/2020
10HSE Abdullrahman Barakat ali.ab.1@pg.com07/18/2020
11HSE  Nour Abdelaziz abdelaziz.n@pg.com17/12/2020
12HSE  Nour Abdelaziz abdelaziz.n@pg.com17/13/2020
13HSE  Nour Abdelaziz abdelaziz.n@pg.com07/14/2020
14HSE  Nour Abdelaziz abdelaziz.n@pg.com07/15/2020
16FC Hesham Barakatbarakat.hs@pg.com17/13/2020
17FC Hesham Barakatbarakat.hs@pg.com17/17/2020
18FC Hesham Barakatbarakat.hs@pg.com07/16/2020
19FC Hesham Barakatbarakat.hs@pg.com07/22/2020
20FC Sameh Mohammedysameh.ms@pg.com17/12/2020
21FC Sameh Mohammedysameh.ms@pg.com07/13/2020
22FC Sameh Mohammedysameh.ms@pg.com07/31/2020
23HSE Mostafa Gamalmetwaly.mg@pg.com18/1/2020
25HSE Mostafa Gamalmetwaly.mg@pg.com18/14/2020
26HSE Mostafa Gamalmetwaly.mg@pg.com08/15/2020
27HSE Mostafa Gamalmetwaly.mg@pg.com08/16/2020
28HSE Mostafa Gamalmetwaly.mg@pg.com08/17/2020
29HSE Abdullrahman Barakat ali.ab.1@pg.com18/13/2020
30HSE Abdullrahman Barakat ali.ab.1@pg.com18/16/2020
31HSE Abdullrahman Barakat ali.ab.1@pg.com08/17/2020
32HSE Abdullrahman Barakat ali.ab.1@pg.com08/18/2020
33HSE  Nour Abdelaziz abdelaziz.n@pg.com17/12/2020
34HSE  Nour Abdelaziz abdelaziz.n@pg.com18/13/2020
35HSE  Nour Abdelaziz abdelaziz.n@pg.com08/14/2020
36HSE  Nour Abdelaziz abdelaziz.n@pg.com08/15/2020
37FC Hesham Barakatbarakat.hs@pg.com18/1/2020
38FC Hesham Barakatbarakat.hs@pg.com18/13/2020
40FC Hesham Barakatbarakat.hs@pg.com08/16/2020
41FC Hesham Barakatbarakat.hs@pg.com08/22/2020
42FC Sameh Mohammedysameh.ms@pg.com18/12/2020
43FC Sameh Mohammedysameh.ms@pg.com08/13/2020
44FC Sameh Mohammedysameh.ms@pg.com08/31/2020

 

5 REPLIES 5
Fowmy
Super User
Super User

@MostafaGamal 

Hi Mostafa,

As per your Measure, there is no data for August that fall <= 2, Please check the attached file you are getting the output as expected.

https://1drv.ms/u/s!AmoScH5srsIYgYIqPIJEhhuCWtoZSw?e=uI6qHA

Fowmy_1-1595664895781.png

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube, LinkedIn

 

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy  you can see in my table that there is values in the coumn " No.OfEntries " in august, so i dont understand what you mean by  " As per your Measure, there is no data for August that fall <= 2 " .. Please Clarify more 

 

Kindly note that the link you provide is not working, i cant open it and download the file 

@MostafaGamal 

Because you SUMMARIZE the table first then add the count that is below or equal 2, your table doesn't have data that qualify.
If you change the 2 to a higher number like 10, it will work,

 SUMX ( FILTER ( tab, [count] <= 2 ), [EntriesCount ] ) 

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy  ok i got it now, so to achieve what i want to do which is " count the values in the first 2 rows for every user in a selected range of date " how to do that? what you suggest ? 

 

the link in the attched in your first comment i cant open it, please share it again 

@MostafaGamal 

Try this measure:


https://1drv.ms/u/s!AmoScH5srsIYgYIqPIJEhhuCWtoZSw?e=QUihP0

Measure = 
SUMX(
FILTER(SUMMARIZE(Sheet1,Sheet1[Mail],"Count",SUM(Sheet1[EntriesCount ])),[Count]<=2),
[Count])

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube, LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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