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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
raj777karthik
Employee
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)

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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