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
jagostinhoCT
Post Partisan
Post Partisan

merging two calculated tables

Hello,

 

I have a source table " ProjectAuditsDB" with values similar to these.

A Project will have more than 1 audit throughout time.

 

ProjectAuditIDProjectIDAuditDateBIM Quality ScoreGradeAudit AgeAudits Status Check
433PPC_BA03433PPC13 June 201610 %Amber20Recent
433PED_BA07433PED14 June 201615 %Red19Recent
433SRMA_BA06433SRMA08 June 20167 %Amber25Recent
B891FMM_BA02B891FMM07 June 20160 %Amber26Recent
A630BDP_BA10A630BDP25 May 20169 %Amber39Dated
433GFO_BA01433GFO23 May 201612 %Amber41Dated
A630POB_BA02A630POB16 May 201625 %Amber48Dated
433LOLH_BA02433LOLH16 May 20169 %Amber48Dated
433PCS_BA04433PCS11 May 201630 %Green53Dated
B879PHM_BA02B879PHM11 May 20167 %Amber53Dated
433LOM_BA04433LOM05 May 20160 %Red59Dated

 

A Summarization table was created using the expression below to allow for the last audits performed to projects.

 

ProjectAuditsDB_LAST AUDITS SCORE = SUMMARIZE(ProjectAuditsDB,ProjectAuditsDB[ProjectID],"AVG-LAST AUDIT",
CALCULATE(AVERAGE(ProjectAuditsDB[BIM Quality Score]),
filter(ProjectAuditsDB,ProjectAuditsDB[AuditDate]=Max(ProjectAuditsDB[AuditDate]))
),
"Last Date",LASTDATE(ProjectAuditsDB[AuditDate]),
"Project Status",DISTINCT(ProjectsDB[ProjectStatus])

 

 

Another Summarization table was created to identify which projects have not been audited at all.

 

ProjectAuditsDB_NOT AUDITED = SUMMARIZE(Filter(ProjectsDB,COUNTROWS(RELATEDTABLE(ProjectAuditsDB))=0),ProjectsDB[ProjectID],ProjectsDB[ProjectStatus],ProjectsDB[Project Format],ProjectsDB[Office])
)

 

(many thanks to @Vvelarde with the help for these)

 

Was trying to create a dashboard which, among other things, would allow me to quickly identify which projects are due on their audit. For such I was thinking on creating a single table with the Last Audits AND the Not Audited data.

 

How would you say it would be the most correct way of doing it?

 

Create another summarize table? append these existing 2? any other ideas?

 

Many thanks for your help.

Joaquim

2 ACCEPTED SOLUTIONS
Vvelarde
Community Champion
Community Champion

hi @jagostinhoCT

 

Try with this:

 

UnionTables = Union(SUMMARIZE('ProjectAuditsDB_LAST AUDITS SCORE';'ProjectAuditsDB_LAST AUDITS SCORE'[ProjectID];
'ProjectAuditsDB_LAST AUDITS SCORE'[Project Status];"Status";"Audited");SUMMARIZE('ProjectAuditsDB_NOT

AUDITED';'ProjectAuditsDB_NOT AUDITED'[ProjectID];'ProjectAuditsDB_NOT AUDITED'[ProjectStatus];"Status";"Not Audited")




Lima - Peru

View solution in original post

@jagostinhoCT

 

To obtain these results, use this:

 

ProjectAuditsDB_1ROW_BEFORE LAST AUDITS SCORE =
SUMMARIZE (
    ProjectAuditsDB;
    ProjectAuditsDB[ProjectID];
    "AVG-LAST AUDIT"CALCULATE (
        AVERAGE ( ProjectAuditsDB[BIM Quality Score] );
        FILTER (
            ProjectAuditsDB;
            ProjectAuditsDB[AuditDate]
                MINX (
                    TOPN ( 2; ProjectAuditsDB; ProjectAuditsDB[AuditDate] );
                    ProjectAuditsDB[AuditDate]
                )
        )
    )
)




Lima - Peru

View solution in original post

10 REPLIES 10

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.