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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
DIACHROMA
Helper II
Helper II

How to calculate a ratio from both measure filtered

Hello everyone, 

 

I need your help please 🙂

 

I have four tables: Date, Customer, Visit, and Sales.


I would like to calculate the rate of customers who had a visit but no sale on the same day.

 

I managed to build a table in which I put the following columns: Date, Customer name, Number of visits, Number of sales.

By applying two filters on this visual: Visit = 1 and Sales = 0, I manage to get the list of customers.

 

However I need to display this as a KPI and therefore calculate the [Number of visits made without sales on the same day] / [Total number of visits].

 

I tried the below but it returns nothing and I forgot the "same day" condition : 

 

Visit w/ Sales =
CALCULATE(
DISTINCTCOUNT( Customer[NAME] ) ,
FILTERVisits , [Number of visit] >= 1 ) ,
FILTER( Sales , [Number of sales ] < 1 )
)

 

Do you have any idea about how to do that please ?

 

Thank you very much!

Pauline

3 REPLIES 3
Anonymous
Not applicable

Hi @DIACHROMA ,

 

It is difficult to create a demo only through words descriptions. Can you show some sample data so that we could test the formula?

 

Best Regards,

Jay

amitchandak
Super User
Super User

@DIACHROMA , Try measure like 1 or the 2

Countx(filter(values( Customer[NAME] ), [Number of visit] >= 1 && (isblank([Number of sales]) || [Number of sales ] < 1)), [NAME])

 

 

Countx(filter(summarize(Sales, customer[Customer], 'Date'[Date], "_1", [Number of visit], "_2" , [Number of sales]), [_1] >= 1 && (isblank([_2]) || [_2] < 1)), [NAME])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

Thank you very much for your help ! I've tried the 1st formula, when I put it in a table I have the correct total (15) but when I put it in a card I have a different result (2) which is not correct.

Let me check with the second one and I'll let you know if it's working.

 

Pauline

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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