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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Richard_Halsall
Helper IV
Helper IV

Matrix Visualisation to filter on 2 date values

Hi

I need help with the following requirement

 

I have the data model as shown

 

Richard_Halsall_0-1723821906610.png

Fact supply is at the contractor and date level and details a contractors availability and training course date

Richard_Halsall_1-1723822365623.png

I would like to create a matrix that allows filtering by training date but shows a different range of the contractors availability

e.g. show me those training courses taken by a contractor in June and that contractors availability in June & July

 

Richard_Halsall_2-1723822954429.png

 

Data for the fact table

Contractor__cDate__cStatus__cFull_Status__cProject_Detail__cPart_Reference__cTotal_Cost__cPurchase_Order__cStatusWithProjectTraining_Date__c
a02Q300000500jVIAQ28/05/2024OOnboarding    O 
a02Q300000500jVIAQ29/05/2024OOnboarding    O 
a02Q300000500jVIAQ30/05/2024OOnboarding    O 
a02Q300000500jVIAQ31/05/2024OOnboarding    O 
a02Q300000500jVIAQ01/06/2024OOnboarding    O 
a02Q300000500jVIAQ02/06/2024OOnboarding    O 
a02Q300000500jVIAQ03/06/2024OOnboarding    O 
a02Q300000500jVIAQ04/06/2024OOnboarding    O 
a02Q300000500jVIAQ05/06/2024OOnboarding    O 
a02Q300000500jVIAQ06/06/2024OOnboarding    O 
a02Q300000500jVIAQ07/06/2024OOnboarding    O 
a02Q300000500jVIAQ08/06/2024TRTraining    TR 
a02Q300000500jVIAQ09/06/2024TRTraining    TR 
a02Q300000500jVIAQ10/06/2024TRTraining    TR 
a02Q300000500jVIAQ11/06/2024TRTraining    TR 
a02Q300000500jVIAQ12/06/2024TRTraining GWO BST - IN HOUSE2000a01Q300000L1o1tIABTR12-Jun-24
a02Q300000500jVIAQ13/06/2024TRTraining    TR 
a02Q300000500jVIAQ14/06/2024TRTraining GEV NFPA 70E Internal100a01Q300000LK1jsIADTR14-Jun-24
a02Q300000500jVIAQ15/06/2024TRTraining    TR 
a02Q300000500jVIAQ16/06/2024TRTraining    TR 
a02Q300000500jVIAQ17/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ18/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ19/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ20/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ21/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ22/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ23/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ24/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ25/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ26/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ27/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ28/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ29/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ30/06/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ01/07/2024LOn Project5790 - Project A   5790 
a02Q300000500jVIAQ02/07/2024LOn Project5790 - Project A   5790 

Any help would be appreciated

1 ACCEPTED SOLUTION

 

Active Training Dates = 
CALCULATE(
    DISTINCTCOUNT(FactSupply[Contractor__c]),
    TREATAS(values(TrainingDates[Date]),FactSupply[Training_Date__c])
    )

 

I don't think I fully understand the premise - feel free to modify

 

 

 

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Richard_Halsall ,

 

First of all, thank you lbendlin  for the quick reply. Did the reply help you solve your problem? If so, please mark it as a solution. If not, you can try the following:

(1) Create a column.

_StatusWithProject = VALUE( IF('Table'[Project_Detail__c]=BLANK(),"0",[StatusWithProject]))

(2) Create a date table.

Date = CALENDAR(DATE(2024,1,1),DATE(2024,12,31)) 

vtangjiemsft_0-1724037831573.png

(3) 

vtangjiemsft_1-1724037856010.pngvtangjiemsft_2-1724037872431.png

If I misunderstand your needs, please clarify them in a follow-up reply.

 

Best Regards,

Neeko Tang

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

Hi @Anonymous @lbendlin , thank you both for your input, I tested both solutions and made progress but still do not have exactly what I require.

Using the disconnected calendar method I have created the TrainingDates table and a Training Dates slicer and this measure

Active Training Dates =
var dateselectmin = minx(allselected(TrainingDates),TrainingDates[Date])
VAR dateselectmax = MAXX(allselected(TrainingDates),TrainingDates[Date])
RETURN
CALCULATE(
    DISTINCTCOUNT(FactSupply[Contractor__c]),
        FILTER(ALL(
        FactSupply),
        FactSupply[Training_Date__c] <= dateselectmax && FactSupply[Training_Date__c] >= dateselectmin
    )
)


Which returns the correct number of unique technicians with a training date between the Training Dates slicer dates when I place the measure in a card
 
My requirement is that these 8 technicians only show in the matrix when the status date range is selected - I have tried using the Active Training Dates measure as a visual filter but it doesn't work

Richard_Halsall_0-1724060166343.png

 

 

Any help would be appreciated. Thanks

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hi 

File can be found at this link

 

https://we.tl/t-Ij9EPvBJ9X

 

Thanks

 

 

 

Active Training Dates = 
CALCULATE(
    DISTINCTCOUNT(FactSupply[Contractor__c]),
    TREATAS(values(TrainingDates[Date]),FactSupply[Training_Date__c])
    )

 

I don't think I fully understand the premise - feel free to modify

 

 

 

 

lbendlin
Super User
Super User

filters on columns in the same table are applied on top of each other.  You seem to want independent filters. That requires the use of disconnected calendar tables to feed your slicers.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.