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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Help with Complex Measures.

Hi, I am very new to Power BI but have been learning quickly until I got into this issue.

Please be gentle on me as I am still new and may not know some of the basics.

 

Background:

I have around 60,000 records in a table that I pull using many SQL joins. As the filters for my visuals are complicated, I created custom columns for filters using and/or conditions. Let's say for visual 1, if all the conditions are satisfied then [Custom_Column_1] will be "True" else "False".

It works fine until here.

 

Problem:

I have three columns in the main table after using Custom_Filter_1 = "True" 

  1. ID,
  2. IDType,
  3. SubmittedDate

Also, I have Calendar table with columns -

  • Date,
  • DateNext,
  • IsWeekDay,
  • IsHoliday,
  • IsToday,
  • IsTomorrow

 

In the main data, ID Type has Mod and Remod options.

Mod has 1 Day of SLA and Remod has 2 days of SLA. These tasks need to be completed before SLA.

For both the ID Types, I need to check if the IDs are in SLA or out of SLA, even if one ID is out of SLA, then it should be "No". Then, I need to count the number of IDs due today and tomorrow based on SLA considering workdays (Calendar table has [IsWeekDay] and [IsHoliday]).

 

I get this data when Custom_Filter_1 is added to the visual level filter:

IDID TypeSubmittedDate
1258Mod11/4/2021
1217Remod11/4/2021
1499Remod11/4/2021
1418Remod11/5/2021
1351Mod11/4/2021
1333Mod11/5/2021
1269Mod11/5/2021
1318Mod11/5/2021
1146Mod11/5/2021
1117Mod11/5/2021
1404Remod11/5/2021
1206Remod11/5/2021
1439Mod11/5/2021
1155Remod11/5/2021
1197Mod11/8/2021
1338Mod11/8/2021
1198Remod11/8/2021
1146Remod11/8/2021
1168Remod11/8/2021
1126Remod11/8/2021
1289Remod11/9/2021
1355Mod11/9/2021
1016Mod11/9/2021

 

 

Calander Table:

DateDateNextIsWeekDayIsHolidayIsTodayIsTomorrow
11/1/202111/2/202110FALSEFALSE
11/2/202111/3/202110FALSEFALSE
11/3/202111/4/202110FALSEFALSE
11/4/202111/5/202110FALSEFALSE
11/5/202111/6/202110FALSEFALSE
11/6/202111/7/202100FALSEFALSE
11/7/202111/8/202100FALSEFALSE
11/8/202111/9/202110TRUEFALSE
11/9/202111/10/202110FALSETRUE
11/10/202111/11/202110FALSEFALSE

 

Required Output

TaskSLAIn SLA (Y/N)Due TodayTotal Due TodayDue TomorrowTotal Due Tomorrow
Mod1 DayNo210212
Remod2 DaysYes411111

 

  • If [IsWeekDay] = 0 or if [IsHoliday] = 1, then it should be counted as working day and it shouldn't be counted in SLA days.
  • SLA is fixed. 1 days for Mod and 2 days for Remod.
  • For Mod, SLA is 1 day. The task has to be completed before SubmitedDate+1 day. If all the ID Numbers are completed on or before SubmittedDate +1 then "Yes", else "No". The tasks on 11/4/2021 were not completed by 11/5/2021. So it is not in SLA.
  • For Remod, the SLA is 2 days. If no ID number exceeds 2 days from SubmittedDate, then it is in SLA.
    The Tasks 11/4/2021 are in SLA because 6 and 7 were not working days. So, 11/4/2021 tasks can be completed by 11/8/2021.
  • Due Today = Count of IDs that are pending today. i.e. 11/8/2021
  • Total Due Today = Total count of IDs that are pending until today. i.e. on or before 11/08/2021

I really appreciate your help.

1 REPLY 1
lbendlin
Super User
Super User

@Anonymous You mark 11/8/2021 as "today"  yet you have tasks submitted on 11/9/2021 ?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.