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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
BI_Analyticz
Helper V
Helper V

Create a summary dashboard with max occurrence of status in matrix table-Most Complex ever designed

I have 2 datasets

 

1. List if distinct PC Names

2. List of the same PC names with Compliant status for every month. For some PC's there will be no status for a particular month. In that case we have to consider those as Compliant automatically.

 

Datasets.

Dataset 1 Dataset 2
PC Name PC NamePatch MonthCompliant Status
Comp A Comp AJan-22Compliant
Comp B Comp AJan-22Compliant
Comp C Comp AJan-22Compliant
Comp D Comp AJan-22Non-Compliant
Comp E Comp AFeb-22Non-Compliant
  Comp AFeb-22Non-Compliant
  Comp AFeb-22Compliant

 

I looking for a resultant dashboard as below or a new dataset as shown in another screenshot. I am kind of stuck since this is a pretty large database with 25 lakh rows. So I am stuck to decide the best practice for this dashboard requirement. How can I achieve this...?

 

BI_Analyticz_0-1647496089333.png

 

BI_Analyticz_1-1647496128216.png

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Hi, @BI_Analyticz 

You need to create a seperated table for field 'Patch Month'。

 

Patch Month = DISTINCT('Dateset 2'[Patch Month])

 

Then try formula as below:
calculated columns in dataset2

 

Count1 = CALCULATE (COUNTROWS ( 'Dateset 2' ),ALLEXCEPT ('Dateset 2','Dateset 2'[PC Name],'Dateset 2'[Patch Month],'Dateset 2'[Compliant Status]))
Count2 = CALCULATE (MAX ( 'Dateset 2'[Count1] ),ALLEXCEPT ( 'Dateset 2', 'Dateset 1'[PC Name], 'Dateset 2'[Patch Month] ))
max occurrence of status = 
CALCULATE (
    MAX ( 'Dateset 2'[Compliant Status] ),
    FILTER (
        'Dateset 2',
        'Dateset 2'[PC Name] = EARLIER ( 'Dateset 2'[PC Name] )
            && 'Dateset 2'[Patch Month] = EARLIER ( 'Dateset 2'[Patch Month] )
            && 'Dateset 2'[Count1] = 'Dateset 2'[Count2]
    )
)

measure:

M_Compliant Status = 
VAR _status =
    CALCULATE (
        Max ( 'Dateset 2'[max occurrence of status] ),
        FILTER (
            'Dateset 2',
            'Dateset 2'[PC Name] = SELECTEDVALUE ( 'Dateset 1'[PC Name] )
                && 'Dateset 2'[Patch Month] = SELECTEDVALUE ( 'Patch Month'[Patch Month] )
        )
    )
RETURN
    IF ( ISBLANK ( _status ), "Compliant", _status )

 

Result:

15.png

 

Best Regards,
Community Support Team _ Eason

View solution in original post

6 REPLIES 6
BI_Analyticz
Helper V
Helper V

Guys no suggestions for my query?

Hi, @BI_Analyticz 

You need to create a seperated table for field 'Patch Month'。

 

Patch Month = DISTINCT('Dateset 2'[Patch Month])

 

Then try formula as below:
calculated columns in dataset2

 

Count1 = CALCULATE (COUNTROWS ( 'Dateset 2' ),ALLEXCEPT ('Dateset 2','Dateset 2'[PC Name],'Dateset 2'[Patch Month],'Dateset 2'[Compliant Status]))
Count2 = CALCULATE (MAX ( 'Dateset 2'[Count1] ),ALLEXCEPT ( 'Dateset 2', 'Dateset 1'[PC Name], 'Dateset 2'[Patch Month] ))
max occurrence of status = 
CALCULATE (
    MAX ( 'Dateset 2'[Compliant Status] ),
    FILTER (
        'Dateset 2',
        'Dateset 2'[PC Name] = EARLIER ( 'Dateset 2'[PC Name] )
            && 'Dateset 2'[Patch Month] = EARLIER ( 'Dateset 2'[Patch Month] )
            && 'Dateset 2'[Count1] = 'Dateset 2'[Count2]
    )
)

measure:

M_Compliant Status = 
VAR _status =
    CALCULATE (
        Max ( 'Dateset 2'[max occurrence of status] ),
        FILTER (
            'Dateset 2',
            'Dateset 2'[PC Name] = SELECTEDVALUE ( 'Dateset 1'[PC Name] )
                && 'Dateset 2'[Patch Month] = SELECTEDVALUE ( 'Patch Month'[Patch Month] )
        )
    )
RETURN
    IF ( ISBLANK ( _status ), "Compliant", _status )

 

Result:

15.png

 

Best Regards,
Community Support Team _ Eason

BI_Analyticz
Helper V
Helper V

Guys any suggestions please

BI_Analyticz
Helper V
Helper V

@amitchandak 

BI_Analyticz_0-1647500646490.png

this is the dashboard needed using the 2 datasets

amitchandak
Super User
Super User

@BI_Analyticz , second and thrid dashboard are matrix and table display using the 2 tables in first screenshot(or Data) 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak any ideas please. Need your help.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.