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
Anonymous
Not applicable

Product of measure (help remove depending on filter selection)

Hello,

 

I am having trouble showing a measure in a matrix I created unless I select a slicer. My calculation is as follows:

Backlog Weight =
var selectedFilter = ALLSELECTED(Fact_Self_Sufficiency[Custom field (Severity)])
return
CALCULATE(Fact_Backlog_data[Backlog Contribution Score_1],
FILTER(SLA_Severity, SLA_Severity[Severity] in selectedFilter))
 
 
Backlog Weight Calc Sev2 =
IF(SELECTEDVALUE(Fact_Backlog_data[Custom field (Severity)]) = "Sev 1 - Critical",  Fact_Backlog_data[Backlog Weight Calc Sev1] * .4,
IF(SELECTEDVALUE(Fact_Backlog_data[Custom field (Severity)]) = "Sev 2 - Major", Fact_Backlog_data[Backlog Weight Calc Sev1] * .3,
IF(SELECTEDVALUE(Fact_Backlog_data[Custom field (Severity)]) = "Sev 3 - Minor", Fact_Backlog_data[Backlog Weight Calc Sev1] * .2,
IF(SELECTEDVALUE(Fact_Backlog_data[Custom field (Severity)]) = "Sev 4 - Trivial", Fact_Backlog_data[Backlog Weight Calc Sev1] * .1
))))
 
I want my measure to check the Fact_Backlog_data[Custom field (Severity)], which is a column. The above solution works, but I only see my values upon selection of a filter.
 
How do I create a measure with multiple if statements without being depending on selection of filter value?
Ideally, I'd want my formula to look like this:
 
Backlog Weight Calc Sev2 =
IF(Fact_Backlog_data[Custom field (Severity)] = "Sev 1 - Critical",  Fact_Backlog_data[Backlog Weight Calc Sev1] * .4,
IF(Fact_Backlog_data[Custom field (Severity)] = "Sev 2 - Major", Fact_Backlog_data[Backlog Weight Calc Sev1] * .3,
IF(Fact_Backlog_data[Custom field (Severity)] = "Sev 3 - Minor", Fact_Backlog_data[Backlog Weight Calc Sev1] * .2,
IF(Fact_Backlog_data[Custom field (Severity)] = "Sev 4 - Trivial", Fact_Backlog_data[Backlog Weight Calc Sev1] * .1
))))
removed selectedvalue function but I can't seem to find a workaround. The reason why I need these ifs to check the severity value is because I am multiplying by .4, .3, .2, .1 respectively. The Fact_Backlog_data[Custom field (Severity)] field is included in every record in the table.
1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi danieljkim17,

 

It seems that you don’t want to use multiple if condition to filter data, right? If so, you could try to follow below sample:

88.png

Then use new table as Slier table, and create measure like below

temp = CALCULATE(MIN(slicer[multiply]), FILTER(slicer,slicer[type]=MIN('fact'[type])))*SUM('fact'[amount])



Measure 6 = if(ISFILTERED(slicer[type]),SUM('fact'[amount])*MIN(slicer[multiply]),SUMX(ALLSELECTED('fact'),[temp]))

87.PNG

Best Regards,

Zoe Zhi

 

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

2 REPLIES 2
Anonymous
Not applicable

Table3.PNGtable4.PNGtable5.PNG

 

I should also note that upon selection of a severity using a slicer, the values change based on selection of severity.

 

And when none is selected, I want to see a total of all severities (1-4) but I get no values returned.

 

 

dax
Community Support
Community Support

Hi danieljkim17,

 

It seems that you don’t want to use multiple if condition to filter data, right? If so, you could try to follow below sample:

88.png

Then use new table as Slier table, and create measure like below

temp = CALCULATE(MIN(slicer[multiply]), FILTER(slicer,slicer[type]=MIN('fact'[type])))*SUM('fact'[amount])



Measure 6 = if(ISFILTERED(slicer[type]),SUM('fact'[amount])*MIN(slicer[multiply]),SUMX(ALLSELECTED('fact'),[temp]))

87.PNG

Best Regards,

Zoe Zhi

 

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

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.