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
Anonymous
Not applicable

Count of Projects from Min Stage to Max Stage Display in Matrix Visual

Hi Everyone,

 

I am trying to create matrix visual based on my sample data for project transition, based on date of status change selection my projects from stage and to stage should be changed and always I should showcase latest stage for project

Sample Input:

pavan290992_0-1661447764723.png

Expected Output

When I Select Date From 11-16-2021 to 5-25-2022 or after

pavan290992_1-1661448026208.png

When I Select Date From 11-16-2021 to 5-24-2022

pavan290992_3-1661448119324.png

Always project status transition is from Latest From Status to Latests To Status.

Thanks Advance for your help!

 



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tamerj1 
Thanks for looking into it, I did some changes in KPI logic, here is logic which is working as expected for me

Assigned =
VAR _FromDate=SELECTEDVALUE('From Date'[Date])
VAR _ToDate=SELECTEDVALUE('To Date'[Date])
VAR _Status=SELECTEDVALUE('Status'[Status])
VAR _FromId=CALCULATETABLE(VALUES('Deal Pipeline'[ID]),'Deal Pipeline'[Date]=_FromDate)
VAR _ToID=CALCULATETABLE(VALUES('Deal Pipeline'[ID]),'Deal Pipeline'[Date]=_ToDate
&& 'Deal Pipeline'[Status]="Assigned")
VAR _Except=INTERSECT(_FromId,_ToID)
VAR _Result=
COALESCE(CALCULATE(COUNTROWS(_Except)),0)
RETURN
_Result

Created 2 Date Tables and Joined to DealPipeline Fact based on Date Column.

Computed Date Column in Power Query like below
Table.AddColumn(#"Added Custom", "Date", each {Number.From([From DAte])..Number.From([To_Date])})

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Previous Status-Rows
Status-Columns

@Anonymous 

Interesting problem. So the previous status is always the first one and the status is always the last one? This won't work using the columns from the same table. It would require two duplicate tables having all unique status values, one to be placed on rows and one tobe placed on columns. Yet it will remain tricky. I will try to work on it tomorrow. 

Anonymous
Not applicable

Thanks @tamerj1 , for checking on it, Yes we need to showcase as columns but the challenge here is based on date selection it should show case min status->max status transition and count against status with measures I could able to achive but ask from client is to showcase as matrix, pls let me know if any findings 
Thanks Again for checking...

Hi @Anonymous 
Not sure if this is what you need. Please refer to attached sample file

3.png1.png2.png

Count = 
SUMX ( 
    VALUES ( Data[ID] ),
    CALCULATE ( 
        VAR SelectedStatus = SELECTEDVALUE ( 'Status'[Status] )
        VAR SelectedPreStatus = SELECTEDVALUE ( Previous_Status[Previous Status] )
        VAR CurrentIDTable = CALCULATETABLE ( Data, ALLSELECTED ( 'Date' ) )
        VAR LastStatusDate = MAXX ( CurrentIDTable, Data[Date of Status Change] )
        VAR LastStatus = MAXX ( FILTER ( CurrentIDTable, Data[Date of Status Change] = LastStatusDate ), Data[Status] )
        VAR FirstPreStatusDate = MAXX ( TOPN ( 2, CurrentIDTable, Data[Date of Status Change], ASC ), Data[Date of Status Change] )
        VAR FirstPreStatus = MAXX ( FILTER ( CurrentIDTable, Data[Date of Status Change] = FirstPreStatusDate ), Data[Previous Status] )
        RETURN 
            IF (
                SelectedStatus = LastStatus && SelectedPreStatus = FirstPreStatus,
                1,
                0
            ) 
    )
)
Anonymous
Not applicable

Hi @tamerj1 
Thanks for looking into it, I did some changes in KPI logic, here is logic which is working as expected for me

Assigned =
VAR _FromDate=SELECTEDVALUE('From Date'[Date])
VAR _ToDate=SELECTEDVALUE('To Date'[Date])
VAR _Status=SELECTEDVALUE('Status'[Status])
VAR _FromId=CALCULATETABLE(VALUES('Deal Pipeline'[ID]),'Deal Pipeline'[Date]=_FromDate)
VAR _ToID=CALCULATETABLE(VALUES('Deal Pipeline'[ID]),'Deal Pipeline'[Date]=_ToDate
&& 'Deal Pipeline'[Status]="Assigned")
VAR _Except=INTERSECT(_FromId,_ToID)
VAR _Result=
COALESCE(CALCULATE(COUNTROWS(_Except)),0)
RETURN
_Result

Created 2 Date Tables and Joined to DealPipeline Fact based on Date Column.

Computed Date Column in Power Query like below
Table.AddColumn(#"Added Custom", "Date", each {Number.From([From DAte])..Number.From([To_Date])})
tamerj1
Super User
Super User

Hi @Anonymous 

which column is in the rows and which colum is in the columns of the matrix?

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