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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
mdaatifraza5556
Super User
Super User

total day between range slicer and free from slicer grade

Hi 
Here are samples, kindly help me with this I think if i get solved on this, then it will work

below i am providing some sample what i want is. 
I want total days when i am selecting start and end date in range slicer then it gives me total days and that total days should not be affected by grade slicer if selecting any one of the grade


Statrt DateGradeCode
01-03-2025211287
01-03-2025211287
02-03-202584693
02-03-202584693
02-03-202584693
03-03-2025257533
03-03-2025257533
03-03-2025257533
03-03-2025212202
03-03-2025257533
04-03-2025267520
04-03-2025267520
04-03-2025267520
05-03-2025257533


Thank you

2 ACCEPTED SOLUTIONS
Akash_Varuna
Super User
Super User

Hi @mdaatifraza5556 Try these please 

  1. Create a Date Table:
DateTable = CALENDAR(MIN('YourTable'[Start Date]), MAX('YourTable'[Start Date]))
  1. Create a Measure:
Total Days = 
VAR StartDate = MIN('DateTable'[Date])
VAR EndDate = MAX('DateTable'[Date])
RETURN DATEDIFF(StartDate, EndDate, DAY) + 1
  1. Exclude Grade Slicer:
    Use the ALL function to ignore the Grade slicer:
Total Days = 
VAR StartDate = MIN('DateTable'[Date])
VAR EndDate = MAX('DateTable'[Date])
RETURN DATEDIFF(StartDate, EndDate, DAY) + 1

Place the measure in a Card visual.
If this post helped please do give a kudos and accept this as a solution
Thanks In Advance

View solution in original post

danextian
Super User
Super User

Hi @mdaatifraza5556 

 

Create a separate dates dimension table and relate it to your fact table in a one-to-many relationship so the count of days doesnt get affected by Grade Code. Please see the attached sample pbix.

danextian_0-1741598726562.png

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
danextian
Super User
Super User

Hi @mdaatifraza5556 

 

Create a separate dates dimension table and relate it to your fact table in a one-to-many relationship so the count of days doesnt get affected by Grade Code. Please see the attached sample pbix.

danextian_0-1741598726562.png

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thank you so much to all for the reply.
I got my solution, I was having an issues in the data modeling.

Anonymous
Not applicable

Hi @mdaatifraza5556 ,
Thank you @danextian for the helpful response!
Glad that your query got resolved.Kindly accept the solution that helped you or share your answer and accept is as solution.

Thank you.

Regards,
Pallavi.

Akash_Varuna
Super User
Super User

Hi @mdaatifraza5556 Try these please 

  1. Create a Date Table:
DateTable = CALENDAR(MIN('YourTable'[Start Date]), MAX('YourTable'[Start Date]))
  1. Create a Measure:
Total Days = 
VAR StartDate = MIN('DateTable'[Date])
VAR EndDate = MAX('DateTable'[Date])
RETURN DATEDIFF(StartDate, EndDate, DAY) + 1
  1. Exclude Grade Slicer:
    Use the ALL function to ignore the Grade slicer:
Total Days = 
VAR StartDate = MIN('DateTable'[Date])
VAR EndDate = MAX('DateTable'[Date])
RETURN DATEDIFF(StartDate, EndDate, DAY) + 1

Place the measure in a Card visual.
If this post helped please do give a kudos and accept this as a solution
Thanks In Advance

SamanthaPuaXY
Helper II
Helper II

HI @mdaatifraza5556 

 

Please try this 

Total Days =
VAR MinDate = CALCULATE( MIN('Table'[StartDate]), REMOVEFILTERS('Table'[GradeCode]) )
VAR MaxDate = CALCULATE( MAX('Table'[StartDate]), REMOVEFILTERS('Table'[GradeCode]) )
RETURN
DATEDIFF(MinDate, MaxDate, DAY) + 1

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.