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
YogeshS
Frequent Visitor

Need help creating a Matrix visual to display duration between dates

I am using a Matrix table where in row i added vehicle number and in Column I added date. I want to show 1 from the date of Breakdown till the Ready date. Help me to slove this.

 

For Example:

 

Vehicle NoBreakdown DateReady Date
1234502-01-202406-01-2024
6789804-01-202408-01-2024
1235201-01-202402-01-2024

 

Result needed to be:

 

Vehicle No01-01-202402-01-202403-01-202404-01-202405-01-202406-01-202407-01-202408-01-202409-01-202410-01-2024
12345 11111    
67898   11111  
1235211        
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1711940827774.png

 


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

View solution in original post

6 REPLIES 6
YogeshS
Frequent Visitor

Thank You!!
@v-yilong-msft , @Ashish_Mathur 
It worked.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1711940827774.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-yilong-msft
Community Support
Community Support

Hi @YogeshS,

I’d like to acknowledge the valuable input provided by the @Uzi2019. His initial ideas were instrumental in guiding my approach. However, I noticed that further details were needed to fully understand the issue. In my investigation, I took the following steps:

I create two tables as you mentioned.

vyilongmsft_0-1711938069242.png

vyilongmsft_3-1711939828250.png

Then I create a Table 2.

Table 2 =
ADDCOLUMNS (
    CROSSJOIN ( 'Date (2)', 'Table' ),
    "IF",
        IF (
            'Date (2)'[Date] >= 'Table'[Breakdown Date]
                && 'Date (2)'[Date] <= 'Table'[Ready Date],
            1,
            0
        )
)

vyilongmsft_4-1711939957050.png

Finally you will get what you want.

vyilongmsft_1-1711939107255.png

If you want to let the 0 become the blank, I think you can do some changes.

Table 2 =
ADDCOLUMNS (
    CROSSJOIN ( 'Date (2)', 'Table' ),
    "IF",
        IF (
            'Date (2)'[Date] >= 'Table'[Breakdown Date]
                && 'Date (2)'[Date] <= 'Table'[Ready Date],
            1,
            BLANK ()
        )
)

vyilongmsft_5-1711940000337.png

 

 

 

Best Regards

Yilong Zhou

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

 

 

 

 

 

 

 

 

 

Uzi2019
Super User
Super User

Hi @YogeshS 

what is 1 represent?? is it count of Nobreakdown or first date like date 1 of every month?

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Hi...
We can use any representation, even text like 'BD', to indicate that a vehicle was at breakdown on a certain date. I used '1' as a placeholder, but the objective is to display the dates when each vehicle experienced a breakdown and the placeholder should be filled on the following dates until the ready date.

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.