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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Super User
Super User

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
Super User
Super User

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors