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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
nutyfreshz
Frequent Visitor

Count with Filter Measure

I have 2 Total Clicks measures which calculate current & last month. And i want to count(linelog) which Total clicks(Current) > Total clicks(last month)

Total clicks(current) = TOTALMTD(
COUNT('villa_040322'[lineLog])
,'villa_040322'[clickAt.1].[Date])

Total clicks(lstmonth) = CALCULATE(
COUNT('villa_040322'[lineLog])
,DATEADD('villa_040322'[clickAt.1].[Date],-1,MONTH))

but I used this code and it provides only count(linelog) with no filter.

Measure = CALCULATE(DISTINCTCOUNT('villa_040322'[lineLog]),FILTER('villa_040322','villa_040322'[Total clicks(current)]>='villa_040322'[Total clicks(lstmonth)])

How did I change this code to count no. unique of linelog which Total clicks(current) > Total clicks(lstmonth) in red area in scatterpot.

 

Screenshot_24.png

Thank you.

1 ACCEPTED SOLUTION

Hi @nutyfreshz ,

 

Sorry, i made a mistake. I didn't realize that the [Total clicks(current)] and [Total clicks(lsmonth)] are measure.

 

If possible, you can change these measures to column, or summarize function to create a template table. Or please share your pbix file without sensitive data. 

 

Best Regards

Community Support Team _ chenwu zhu

 

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

5 REPLIES 5
v-chenwuz-msft
Community Support
Community Support

Hi @nutyfreshz ,

 

You can should try to add function like selectedvalue() or max() after "field name >=", like the highlighting code.

 

Measure = CALCULATE(DISTINCTCOUNT('villa_040322'[lineLog]),FILTER('villa_040322','villa_040322'[Total clicks(current)]>=selectedvalue('villa_040322'[Total clicks(lstmonth)]))

 

If it does not work, please share your pbix file without sensitive data.

 

Best Regards

Community Support Team _ chenwu zhu

 

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

nutyfreshz_0-1647059178063.png

Select value working with Cols but 

[Total clicks(current)] & [Total clicks(lstmonth)]

These are measure not cols. any idea?

 

Thank you.

Hi @nutyfreshz ,

 

Sorry, i made a mistake. I didn't realize that the [Total clicks(current)] and [Total clicks(lsmonth)] are measure.

 

If possible, you can change these measures to column, or summarize function to create a template table. Or please share your pbix file without sensitive data. 

 

Best Regards

Community Support Team _ chenwu zhu

 

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

I think I need to create a new table with summarizing and join then filter as column.

 

I will try, thanks for the solution. I will send pbix file in dm.

 

Thank you so much.

Thank you so much, i will try in a second.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.