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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
JamesBurke
Helper III
Helper III

Count rows

Hi all , 

 

JamesBurke_0-1731546834476.png

 

Have all of the rows attached with 5 different Meters  , looking to make a column that counts the rows 

 

Health = IF([UsagesCount test 2] > 48 = "Not Connected" , "Connected")

 

UsagesCount test 2 = CALCULATE(COUNTROWS('National Grid Data'), FILTER('Emporia Devices',[Total solar Generated] > 0.1))

 

I have the above measures , i essentially want a way to track the connectivity of the 5 different meters by saying there was 48 rows today ( it's half hourly data ) so it's connected and if it's below 48 then it's not connected. 

 

 

Any help would be appericated 

 

1 ACCEPTED SOLUTION
Bibiano_Geraldo
Memorable Member
Memorable Member

Hi @JamesBurke ,
First of all, your Health measure needs some adjustments to work correctly in DAX. The IF function is being used incorrectly, and the syntax needs to be fixed. Here’s how it should look:

 

Health = IF([UsagesCount test 2] >= 48, "Connected", "Not Connected")

 

 

NOTE: If the above measure help your problem you cant stop right here, if not, please follow the bellow steps.

 

Try to first Create a Calculated Column to Count Rows by this DAX:

 

RowCount = 
CALCULATE (
    COUNTROWS('National Grid Data'),
    FILTER (
        'National Grid Data',
        'National Grid Data'[Meter ID] = EARLIER('National Grid Data'[Meter ID]) &&
        'National Grid Data'[Date] = EARLIER('National Grid Data'[Date])
    )
)

 

 

Now, create another calculated column to determine the health status based on the row count by this DAX:

 

Health = 
IF (
    [RowCount] >= 48, 
    "Connected", 
    "Not Connected"
)

 

 

This approach ensures that you are evaluating the connectivity status for each meter based on the number of data points recorded for each day.

If this reply help you, please accept as solution and give a Kudo.

 

thank you

I hope this helps! 
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
 Give it a like to show your appreciation!

Thank you for contributing to our amazing Power BI community! 

View solution in original post

3 REPLIES 3
Bibiano_Geraldo
Memorable Member
Memorable Member

Hi @JamesBurke ,
First of all, your Health measure needs some adjustments to work correctly in DAX. The IF function is being used incorrectly, and the syntax needs to be fixed. Here’s how it should look:

 

Health = IF([UsagesCount test 2] >= 48, "Connected", "Not Connected")

 

 

NOTE: If the above measure help your problem you cant stop right here, if not, please follow the bellow steps.

 

Try to first Create a Calculated Column to Count Rows by this DAX:

 

RowCount = 
CALCULATE (
    COUNTROWS('National Grid Data'),
    FILTER (
        'National Grid Data',
        'National Grid Data'[Meter ID] = EARLIER('National Grid Data'[Meter ID]) &&
        'National Grid Data'[Date] = EARLIER('National Grid Data'[Date])
    )
)

 

 

Now, create another calculated column to determine the health status based on the row count by this DAX:

 

Health = 
IF (
    [RowCount] >= 48, 
    "Connected", 
    "Not Connected"
)

 

 

This approach ensures that you are evaluating the connectivity status for each meter based on the number of data points recorded for each day.

If this reply help you, please accept as solution and give a Kudo.

 

thank you

I hope this helps! 
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
 Give it a like to show your appreciation!

Thank you for contributing to our amazing Power BI community! 
Uzi2019
Super User
Super User

Hi @JamesBurke 

 

You question is half complete .Please write complete query with sample data and expected output. try to cover everything. 

we dont know what is National grid data , Total solar genrated 

what do you mean by 48 row count is it for today only for 1 meter or 5 meter. 

 

You have clearly specify everything step by step using excel data your problem statement then only others users would able to help you to solve your query.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
ryan_mayu
Super User
Super User

not clear about the questions. pls paste the sample data in your post(not the screenshot) and the expectd output based on the sample data you provided. 





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

Proud to be a Super User!




Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.