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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Eng-mohd
Helper I
Helper I

undefined power bi

I have sheets 

Sheet1  have id and its duration time 

Sheet2 have id and its duration time 

 

I wana calculate how many person take mor than 119 minutes 

 

And i wana sure there is no repeated id 

 

2 ACCEPTED SOLUTIONS
some_bih
Community Champion
Community Champion

Hi @Eng-mohd if your sheet 1 and sheet 2 have the same structure,  and data for durations is in minutes (same in two sheets) possible solution (adjsust sheets / column names to your need)
1. Create new table 

CombinedTable = UNION(Sheet1, Sheet2)

2. Create measure

Persons_More_Than119Minutes =
CALCULATE(
COUNTROWS(DISTINCT(CombinedTable[ID])),
CombinedTable[Duration] > 119
)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






View solution in original post

Anonymous
Not applicable

Hi @Eng-mohd ,

You can create a measure as below to get it, please find the details in the attachment.

Measure = 
VAR _sheet1 =
    CALCULATETABLE (
        VALUES ( 'Sheet1'[id] ),
        FILTER ( 'Sheet1', 'Sheet1'[duration time] > 119 )
    )
VAR _sheet2 =
    CALCULATETABLE (
        VALUES ( 'Sheet2'[id] ),
        FILTER ( 'Sheet2', 'Sheet2'[duration time] > 119 )
    )
VAR _tab =
    DISTINCT ( UNION ( _sheet1, _sheet2 ) )
RETURN
    COUNTROWS ( _tab )

vyiruanmsft_0-1703556467916.png

Best Regards

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Eng-mohd ,

You can create a measure as below to get it, please find the details in the attachment.

Measure = 
VAR _sheet1 =
    CALCULATETABLE (
        VALUES ( 'Sheet1'[id] ),
        FILTER ( 'Sheet1', 'Sheet1'[duration time] > 119 )
    )
VAR _sheet2 =
    CALCULATETABLE (
        VALUES ( 'Sheet2'[id] ),
        FILTER ( 'Sheet2', 'Sheet2'[duration time] > 119 )
    )
VAR _tab =
    DISTINCT ( UNION ( _sheet1, _sheet2 ) )
RETURN
    COUNTROWS ( _tab )

vyiruanmsft_0-1703556467916.png

Best Regards

Eng-mohd
Helper I
Helper I

No its not same structure  and ther is no relationship between theme 

@Eng-mohd share structure and details with expected output





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Spoiler
No its not same structure 

some_bih
Community Champion
Community Champion

Hi @Eng-mohd if your sheet 1 and sheet 2 have the same structure,  and data for durations is in minutes (same in two sheets) possible solution (adjsust sheets / column names to your need)
1. Create new table 

CombinedTable = UNION(Sheet1, Sheet2)

2. Create measure

Persons_More_Than119Minutes =
CALCULATE(
COUNTROWS(DISTINCT(CombinedTable[ID])),
CombinedTable[Duration] > 119
)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.