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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kmes912
Helper I
Helper I

How to Ignore Granularity of Dataset

I have data that is aggregated as DATE>UNIT>DEPT>CODE>JOB then value for regular hours and scheduled hours, like below.

 

 

DateUnitDeptUnit DeptCodeJobRegSch
1/29/202112345001012345-00105678JOB 188
1/29/202112345001112345-0011567JOB 2816
1/29/202112345001112345-0011567JOB 382
1/29/202112345001212345-00128JOB 4820
1/29/202112345001312345-00133JOB 500
1/29/202112345001412345-00142JOB 608

 

I'm trying to do a lot of different things, and I dont know if I need to do a summarized table to get there, or there is a way within a measure to aggregate differently.

 

First thing, I want to ignore the job & code detail, that doesnt matter to me. I need to keep analysis at the UNIT-DEPT combo, so I made that as a column merged.

 

First I took a DISTINCTCOUNT of UNIT-DEPT column, to show the total of how many combinations they are, with FILTER >0 for reg or >0 in sch so I in essence ignore the department 0013 with 0,0. 

Second I took a DISTINCTCOUNT of UNIT-DEPT column, to show the total of how many combinations they are, with FILTER >0 for reg AND >0 in sch so I can get a count for dept 0014 as that is considered a bad dept (1st minus 2nd equals this flagged situation).

 

My problem becomes when I want to aggregate the remaining values. Depts 0010, 0011, 0012, I want to test how they perform when comparing REG HRS & SCH HRS. I want to know how many departments are in the range of <90%, >110% if you take REG/SCH. Whenever I do the math: 

CALCULATE(DISTINCTCOUNT('Table'[Unit Dept]),FILTER('Table',[Actual vs Schedule %]<.9)), I end up with a big value, I believe because it's still retaining the code & Job level.
 
Do I need to do a summarize table to get to this? Is there a way to within the existing structure? 
2 REPLIES 2
lbendlin
Super User
Super User

You don't need any aggregations or summarized tables. The Power BI data model and the measures can do all that work for you.

 

You say you want to do this by dept and unit.  But your sample data has the same unit.  PLease provide better sample data.

Yes, it has millions of lines. It has a year of dates and 900 units and tons of unit/dept combinations. I was just trying to show in the sample data that 0011 shows 2x but I need to aggregate the (8+8) reg (2+16) sch to come to 16/18 for the value for that dept, then evaluate what range it falls into. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors