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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
darko861
Resolver II
Resolver II

Get Average in a measure by using a filter

Hi Community,

I have a table visual that has two measures called Rev per hour 1 and Rev per hour 2. As seen below in the last line of the table it gives a total average of 1018 for Rev_per_hour 1 and 1265 for Rev_per_hour_2. But I also have a filter applied to this table visual, Rev_per_hour 2 is not blank, which reduces the number of customers, and changes the outcome.

 

I have also created a multiple card using the same measures Rev_per_hour 1 and Rev_per_hour 2, unfortunately, you cannot filter the card on Rev_per_hour 2 to get the same result as you did in the table visual.

 

If you don't use the filter on Rev_per_hour 2, then both the card visual and the table visual would have the same result.

 

Is there a way to change both measures so that you can add a filter inside both measures where it says Rev_per_hour 2 is not blank?

 

Here are both measures:

rev_per_hour1 = DIVIDE([xxxrev1],[xxxrev1.0],BLANK())
rev_per_hour2 = DIVIDE([xxxrev2],[xxxrev1.0],BLANK())
 
darko861_0-1631466371536.png

 


 


 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @darko86

 

Have you tried creating two cards one for each measure and then make the filter on the correct visual?

 

If that is not a solution can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.

 

If this is not possible you need to make a new measure that 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @darko86

 

Have you tried creating two cards one for each measure and then make the filter on the correct visual?

 

If that is not a solution can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.

 

If this is not possible you need to make a new measure that 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi,

 

I have tried creating two cards one for each measure, unfortunately, it doesn't work.

Yes, a measure needs to be created where it says Rev_per_hour 2 is not blank? Can you create a measure that will give me the desired result and will match the table visual, if so how can I write this measure?

 

Here is a sample file:

https://www.dropbox.com/s/avku655e9ocn8h9/xxx-%20Test%20-%202%20-%20Copy.pbix?dl=0

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.