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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

counting measure result, and use as filter

Backgroud. 

1.PNG

Data

1. Data table ( Machine | Date | Event)

2. Date ( Date | Week | Year )

3. Cust ( Machine | Customer )

 

 

2.PNG

Calculations

1. Average  

      Step 1: Total = Sum (Event)

      Step 2: Average = Divide ( [Total] , Distinctcount ('datatable'[Week]),"")      -> Excel Column BM

 

2. Meet Target? 

       If ( [Average] >= 300, 'Yes','no')   -> Excel Column BO

 

 

3.PNG

Question/Need Help

How do i count # of machines that Meet VS Nomeet? 

For example: 

Overall 10 machines, 4 Yes, 6 no

Customer 1 has 4 machines, 2 yes, 2 no. 

 

Please help! Thanks!

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Anonymous, try these measures:

 

Met Target = IF ( [Average] >= 300, "Yes", "No" )

Met Target Count Yes = 
VAR vMachineTable =
    ADDCOLUMNS ( VALUES ( MachineEvent[Machine] ), "MetTarget", [Met Target] )
VAR vResult =
    SUMX ( vMachineTable, IF ( [MetTarget] = "Yes", 1, 0 ) )
RETURN
    vResult

Met Target Count No = 
VAR vMachineTable =
    ADDCOLUMNS ( VALUES ( MachineEvent[Machine] ), "MetTarget", [Met Target] )
VAR vResult =
    SUMX ( vMachineTable, IF ( [MetTarget] = "No", 1, 0 ) )
RETURN
    vResult

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@DataInsights Thank you very much! It worked!

DataInsights
Super User
Super User

@Anonymous, try these measures:

 

Met Target = IF ( [Average] >= 300, "Yes", "No" )

Met Target Count Yes = 
VAR vMachineTable =
    ADDCOLUMNS ( VALUES ( MachineEvent[Machine] ), "MetTarget", [Met Target] )
VAR vResult =
    SUMX ( vMachineTable, IF ( [MetTarget] = "Yes", 1, 0 ) )
RETURN
    vResult

Met Target Count No = 
VAR vMachineTable =
    ADDCOLUMNS ( VALUES ( MachineEvent[Machine] ), "MetTarget", [Met Target] )
VAR vResult =
    SUMX ( vMachineTable, IF ( [MetTarget] = "No", 1, 0 ) )
RETURN
    vResult

 





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

Proud to be a Super User!




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.