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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
manojk_pbi
Contributor II

Help required to write DAX measure

Hello Friends,

 

I have one scenario to acheive, pls suggest me what is the best approach and how this can be handled. I have provided sample input data and expected output in table. 

 

I have below table with project details (master table) and reporttable is kind of transaction table to store the report details.

in Master table for every project gate dates are defined. If gate is already passed then we should have a corresponding entry in reports table with gate report links.

Use case : We need to loop trough the master table and identify what all project entries missing in reporttable or document links for each gate defined. Every project has planned dates for gates (all gates are not mandatory). We should have G0 & G5 mandatory gates for each projects. In few cases we have report for G2 & G4 as well. If date is not defined in Master table then we don't need to track report in reportstable.

 

Output table has expected data after applying the logic. 

 

Please someone suggest the best approach here and how this can be handled. Is it better to create calculated column or create a calculated measre and use it in visualization.

 

Output Table        
PrjIDPrjNameGateG0 DateG2 DateG4 DateG5 DateGate Reports MissingDocument Link MissingAll Reports available
P1Prj1G502-Feb-202402-Jun-202402-Oct-202402-Dec-2024G4  No
P2Prj2G402-Feb-2024 02-Dec-2024   Yes
P3Prj3G502-Feb-202402-Dec-202402-Dec-202402-Feb-2025G0, G2, G4, G5 No
P4Prj4G502-Feb-2024  02-Feb-2025 G0No
P5Prj5G202-Feb-202402-Jun-202402-Apr-202602-Dec-2026G0 No
ReportsTable   
PrjIDGateLast Gate DateDoc Link
P1G002-Feb-2024link
P1G202-Jun-2024link
P1G502-Dec-2024link
P2G002-Feb-2024link
P2G402-Dec-2024 
P4G002-Feb-2005 
P5G202-Jun-2024link
P4G502-Feb-2005link
Master Table     
PrjIDPrjNameGateG0 DateG2 DateG4 DateG5 Date
P1Prj1G502-Feb-202402-Jun-202402-Oct-202402-Dec-2024
P2Prj2G402-Feb-2024 02-Dec-2024 
P3Prj3G502-Feb-202402-Dec-202402-Dec-202402-Feb-2025
P4Prj4G502-Feb-2024  02-Feb-2025
P5Prj5G302-Feb-202402-Jun-202402-Apr-202602-Dec-2026
1 REPLY 1
GeraldGEmerick
Contributor III

@manojk_pbi Try seeing if the attached PBIX file has the DAX calculations that you are looking for. 

Gate Reports Missing = 
VAR _AllGates = { "G0", "G1", "G2", "G3", "G4", "G5" }
VAR _ProjectGates = DISTINCT( 'ReportsTable'[Gate] )
VAR _MaxGate = SELECTEDVALUE( MasterTable[Gate] )
VAR _MissingGates = EXCEPT( FILTER( _AllGates, [Value] <= _MaxGate ), _ProjectGates )
VAR _Return = CONCATENATEX( _MissingGates, [Value], ", " )
RETURN _Return


Document Link Missing = 
VAR _Table = FILTER( 'ReportsTable', [Doc Link] = BLANK() )
VAR _Return = CONCATENATEX( SELECTCOLUMNS( _Table, "Gate", [Gate] ), [Gate], ", " )
RETURN _Return



All Reports Available = IF( ISBLANK( [Gate Reports Missing] ) && ISBLANK( [Document Link Missing] ), "Yes", "No" )

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (4,724)