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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

multiple date column in table with one slicer

Hi all,

 

I am building out a report that I need to calculate equipments checked rate by people. (whether an equipment is checked by people)

 

  • Each person (people ID) could be assigned numbers of equipments (equipment) 
  • Equipments can be transeferred between people; Date in & Date out specified the period that this equipmet belongs to that person.
  • Check ID and Check Date are generated when person checked the equipment. (empty check ID/check date means never being checked)

 

For example, Equipment 10041 were transferred between poeple 30.35.47; and being checked by 30 two times, 35.47 one time respectively.

 

I have measures that calculated total number of equipments & total number of checked equipments & checked rate (checked/all) 

and they'll be displayed by a Matrix table with hierarchy. (people - equipment - check date)

 

 

I would like to create one Date Slicer for user that they can select a Date range, and then showing the check rate by people.

In this case, I don't know how to combine my date column into one slicer is a better solution. 

If I use "Check Date" as slicer, an equipment whithout being checked won't show up in table. 

 

Anyone knows a solution for this case?

 

Thank you!!

 

schou12_0-1625066690081.png

 

9 REPLIES 9
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

the best way I think is to add a column [Is Checked], then replace the column [Check Date] with [Expected Check Date].

I create a sample, and you can try like this.

-

vxiaotang_0-1625815400427.png

 

Measure1 = 
var _countCheck=CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'), 'Table'[Is Checked]==1&&'Table'[People ID]==MIN('Table'[People ID])))
var _countAll=CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'), 'Table'[People ID]==MIN('Table'[People ID])))
return DIVIDE(_countCheck,_countAll)
filter = 
var _rangeS=CALCULATE(FIRSTDATE('calendar'[Date]),ALLSELECTED('calendar'))
var _rangeE=CALCULATE(LASTDATE('calendar'[Date]),ALLSELECTED('calendar'))
return IF(MIN('Table'[Expected Check Date])<=_rangeE&&MIN('Table'[Expected Check Date])>=_rangeS,1,0)

 

Process:

vxiaotang_1-1625815466168.gif

Result:

vxiaotang_0-1625815987736.png

 

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi,

Just wanted to update here. I am able to get my desired result with below meausres.

 

total_equipment_num= 

var _rangeS=CALCULATE(FIRSTDATE('Calendar'[Date]),ALLSELECTED('Calendar'))

var _rangeE=CALCULATE(LASTDATE('Calendar'[Date]),ALLSELECTED('Calendar'))

return CALCULATE(DISTINCTCOUNT('Table'[Equipment ID]), FILTER('Table','Table'[Date In] <= _rangeE && 'Table' [Date Out] >= _rangeS

 

 

total_inspected_equipment_num=

var _rangeS=CALCULATE(FIRSTDATE('Calendar'[Date]),ALLSELECTED('Calendar'))

var _rangeE=CALCULATE(LASTDATE('Calendar'[Date]),ALLSELECTED('Calendar'))

return CA:CULATE(DISTINCTCOUNT('Table'[Equipment ID], 'Table'[Check Date] <= _rangeE && 'Table'[Chec k Date] >= _rangeS

 

Check Rate = DIVIDE(total_inspected_equipment_num, total_equipment_num, 0)

Anonymous
Not applicable

Tang,

 

I appreciate all your help. However, it looks like a little bit different from what I am trying to do.

I am trying to calculating equipment inspected rate by people. 

So if People 10 has 2 equipment and both are been checked in the selected time, then the rate is 100%.

If only one of them is checked, then 50%; if both of them were checked but not during selected time, then 0%.

Please see my attached table for more details.

schou12_0-1625847005954.png

 

I don't quite understand what does "Expected check date" mean in your example. Can you please explain more? I guess I can build something based on your idea.

 

Thank yous so much!

Ashish_Mathur
Super User
Super User

What does Date In of 1/1/1900 mean?  That does not make any sense.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

1/1/1900 It's more like the date of equipment purchase is not trackable or is long before the system setup.   

Hi,

Well then that is a problem.  My idea was a create as many rows as there are days between Date In and Date Out.  12/31/9999 can always be replaced with Today's date but there is nothing i can do about 1/1/1900.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Right. I think I can't replace 1900/1/1 with the other date. Thank you though.

v-xiaotang
Community Support
Community Support

Hi @Anonymous 

you said, "Check ID and Check Date are generated when person checked the equipment. (empty check ID/check date means never being checked)"

if I understand this sentence correctly, the difficulty lies in which date range the blank cell belongs to.

e.g. 

vxiaotang_5-1625197480392.png

 

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi xiaotang,

You are correct. This also is waht I am concerning about. So is it possible to use Date In & Date out as the slicer to filter this table? If so, every equipment has its onwn Date In/Out. 

 

Another way to think about this, I am able to separate the table into two. That is, 

 

Equipment Table 

People IDEquipment IDDate InDate Out

 

Check Table

Equipment IDCheck IDCheck Date

 

Add relationship in data model. It'd be a One (Equipment table) to Many (Check table) relationship.

With this, is it able to keep Equipment ID without being checked?

 

 

Thank you for your help!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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
Top Kudoed Authors