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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Deemo
Advocate II
Advocate II

Finding number of re-used values based on slicers

Hi All,

 

I need to find total number of flows re-used for more than one department based on date and department slicer.

DepartmentFlowDate
Dept 1Flow1May
Dept 1Flow2June
Dept 1Flow3July
Dept 1Flow4Aug
Dept 2Flow3June
Dept 2Flow5June
Dept 3Flow1May
Dept 3Flow3July
Dept 3Flow4Aug

If I select All departments and date May - June, it shoud display 1 ,as there is only one flow(Flow1) being used in more than 1 department(Dept1,Dept3)

 

If I select All departments and date July - Aug, it should display 2, as there are two flows being used in more than 1 dept.

 

If I select Dept1 and date May - June, it shoud display 1 ,as there is one flow(Flow1) being shared by more than 1 department(Dept1,Dept3)

 

Please help.

Thanks in advance!

9 REPLIES 9
Mariusz
Community Champion
Community Champion

Hi @Deemo 

 

Please see the attached file with a solution, for it to work you will need to add a Department Dimension

Measure = 
VAR __flow = VALUES( 'Table'[Flow] )
RETURN 
CALCULATE(
    SUMX(
        __flow, 
        CALCULATE( INT( COUNTROWS( 'Table' ) > 1 ) )
    ),
    ALLSELECTED( 'Table' ),
    ALL( Department ),
    __flow
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

Mariusz
Community Champion
Community Champion

Hi @Deemo 

 

Try something like this 

Measure = 
VAR __flow = VALUES( 'Table'[Flow] )
RETURN 
CALCULATE(
    SUMX(
        __flow, 
        CALCULATE( INT( COUNTROWS( 'Table' ) > 1 ) )
    ),
    ALLSELECTED(),
    __flow
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Thanks for your reply 

I tried the measure you suggested, It is also considering flows which are being repeated within same department for different dates. However, I want to count only those distinct flows which are being used in more than one departments.

Mariusz
Community Champion
Community Champion

Hi @Deemo 

 

Actually adding ALL( 'Table'[Department] ) to my original measure should work as well

Measure = 
VAR __flow = VALUES( 'Table'[Flow] )
RETURN 
CALCULATE(
    SUMX(
        __flow, 
        CALCULATE( INT( COUNTROWS( 'Table' ) > 1 ) )
    ),
    ALLSELECTED( 'Table' ),
    ALL( 'Table'[Department] ),
    __flow
)

 

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

Hi Mariusz,

 

I modified highligted in your pbix . I didn't get why total and measure is showing 1 in your pbix, whereas in my case, it shows sum of measure which is 3. I am getting same result from nandukrishnavs's  DAX.

Also in my model, if flow3 with dept 1 has another record in May with diffrent date or time, the measure is showing 1.

 

Date, Department and Flows are dimensions, and MainTable has PKs and date with timestamp.

Can you please help me here?

ReUsed.JPG

nandukrishnavs
Community Champion
Community Champion

@Deemo  - try this 

 

FlowCount =
VAR _gp =
    CALCULATETABLE (
        SUMMARIZE ( FlowTable, FlowTable[Flow], "CountVal", COUNT ( FlowTable[Flow] ) ),
        ALL ( FlowTable[Department] )
    )
VAR _flowcount =
    CALCULATE ( COUNTROWS ( FILTER ( _gp, [CountVal] > 1 ) ) )
RETURN
    _flowcount

 

 

If you find this solution useful, please mark this post as an accepted solution.

 

Regards,

Nandu Krishna


Regards,
Nandu Krishna

Thanks for your reply nandukrishnavs.

The measure is not displaying anything. I aslo see that you are counting number of flow directly, however I want only those distinct flows which are being used in multiple departments. 

 

 

@Deemo  - Is it possible to share your pbix file?


Regards,
Nandu Krishna

@Deemo  - It is working for me.

 

out.JPG


Regards,
Nandu Krishna

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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
Top Kudoed Authors