Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 Date | GradeCode |
| 01-03-2025 | 211287 |
| 01-03-2025 | 211287 |
| 02-03-2025 | 84693 |
| 02-03-2025 | 84693 |
| 02-03-2025 | 84693 |
| 03-03-2025 | 257533 |
| 03-03-2025 | 257533 |
| 03-03-2025 | 257533 |
| 03-03-2025 | 212202 |
| 03-03-2025 | 257533 |
| 04-03-2025 | 267520 |
| 04-03-2025 | 267520 |
| 04-03-2025 | 267520 |
| 05-03-2025 | 257533 |
Thank you
Solved! Go to Solution.
Hi @mdaatifraza5556 Try these please
DateTable = CALENDAR(MIN('YourTable'[Start Date]), MAX('YourTable'[Start Date]))Total Days =
VAR StartDate = MIN('DateTable'[Date])
VAR EndDate = MAX('DateTable'[Date])
RETURN DATEDIFF(StartDate, EndDate, DAY) + 1Total Days =
VAR StartDate = MIN('DateTable'[Date])
VAR EndDate = MAX('DateTable'[Date])
RETURN DATEDIFF(StartDate, EndDate, DAY) + 1Place the measure in a Card visual.
If this post helped please do give a kudos and accept this as a solution
Thanks In Advance
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.
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.
Thank you so much to all for the reply.
I got my solution, I was having an issues in the data modeling.
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.
Hi @mdaatifraza5556 Try these please
DateTable = CALENDAR(MIN('YourTable'[Start Date]), MAX('YourTable'[Start Date]))Total Days =
VAR StartDate = MIN('DateTable'[Date])
VAR EndDate = MAX('DateTable'[Date])
RETURN DATEDIFF(StartDate, EndDate, DAY) + 1Total Days =
VAR StartDate = MIN('DateTable'[Date])
VAR EndDate = MAX('DateTable'[Date])
RETURN DATEDIFF(StartDate, EndDate, DAY) + 1Place the measure in a Card visual.
If this post helped please do give a kudos and accept this as a solution
Thanks In Advance
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |