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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
raj777karthik
Microsoft Employee
Microsoft Employee

measure value to be static if should not be filtered

I have a below measure created .This measure has been used in table visual with more columns .But this measure used in table be static while we are using date range slicer from anothr table.I have date range slicer when i slice the date range other columns in table should change but this measure shoulkd be static.

 

Blocked =
var a=CALCULATE(DISTINCTCOUNT(Sales[Salesid]),ALLEXCEPT(order,order[OrderId]),Sales,Sales[PriorityP0]=1||Sales[PriorityP1]=1 ||Sales[PriorityP2]=1)
var b=DISTINCTCOUNT(Sales[Salesid])
return
calculate(coalesce(DIVIDE(a,b),0)

 

In this Sales and order tables are connected and both direction has been used.Slicer dats is from Header table and is connected with order table which is also both direction.Header and Sales table are connected.

 

Note:We cannot change the direction to single.As other visuals might get affected.Please help me on this

2 REPLIES 2
amitchandak
Super User
Super User

@raj777karthik , Assuming Sales is fact and order is the dimension, I have done change in allexcept. It will filter only order id

 

Blocked =
var a=CALCULATE(DISTINCTCOUNT(Sales[Salesid]),ALLEXCEPT(Sales,order[OrderId]),filter(Sales,Sales[PriorityP0]=1||Sales[PriorityP1]=1 ||Sales[PriorityP2]=1))
var b=DISTINCTCOUNT(Sales[Salesid])
return
calculate(coalesce(DIVIDE(a,b),0)

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

Sales is dimension and order is fact.I have changed as per you have suggested but still not working.

In var A i  need s to show sales per order with any of one Priroity =1

In Var B i need to take distinct count of sales id

Then i should divide both A and B .

This output should be static irrespectie os slicer value.

 

Have used remove filter as well .

calculate(coalesce(DIVIDE(a,b),0),REMOVEFILTERS(Header[Header CreatedOn Date]))

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors