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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Michalison
Helper II
Helper II

Counting the number of rows equal to a condition from a calendar

I have created a calendar table (TrendDate) using this formula  

Michalison_0-1721217850830.png

I also have a table called Trend Analysis with this info (there are numerous rows for each course/person the below is a reocrd of 1 persons rows

Michalison_1-1721218139852.png

What I want to do is create a  visual  so that if I pick a date from the calendar i.e. 28/01/2024 it will tell me how many courses where equal to non compliant on that particular day  I have tried numerous ways but got nowhere any suggestions would be good  (ps I do have a relationship 1 to many from the calendar table to the trend analysis table

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi All,

Firstly,  @daircom thanks for the solution!

And @Michalison according to my understanding,  I want to share another method.

For your question, I'll try to reproduce your data for manipulation and filter for Not compliant, hope it helps.

 

 

Count_Not_Compliant = 
CALCULATE(
    COUNTROWS('Trend_Analysis_Data'),
    FILTER(
        'Trend_Analysis_Data',
        'Trend_Analysis_Data'[Compliant Y/N] = "Not compliant" &&
        'Trend_Analysis_Data'[Compliance End Date] >= MIN('TrendDate'[Date]) &&
        'Trend_Analysis_Data'[Compliance End Date] <= MAX('TrendDate'[Date])
    )
)

 

 

vxingshenmsft_0-1722301345902.png

 

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 



 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi All,

Firstly,  @daircom thanks for the solution!

And @Michalison according to my understanding,  I want to share another method.

For your question, I'll try to reproduce your data for manipulation and filter for Not compliant, hope it helps.

 

 

Count_Not_Compliant = 
CALCULATE(
    COUNTROWS('Trend_Analysis_Data'),
    FILTER(
        'Trend_Analysis_Data',
        'Trend_Analysis_Data'[Compliant Y/N] = "Not compliant" &&
        'Trend_Analysis_Data'[Compliance End Date] >= MIN('TrendDate'[Date]) &&
        'Trend_Analysis_Data'[Compliance End Date] <= MAX('TrendDate'[Date])
    )
)

 

 

vxingshenmsft_0-1722301345902.png

 

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 



 

 

daircom
Resolver II
Resolver II

@Michalison ,
You could create a slicer and move the date column of your calendar to it.

Then create the followng measure the following formula:

measure = CALCULATE(COUNT(table[Compliance Y/N]), FILTER(table, table[Complance Y/N] = "Not compliant"))

 

then also show this measure in a visual (you still have to replace "table" with your actual table in the DAX formula)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors