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
StephenF
Responsive Resident
Responsive Resident

Custom Filtered Measure breaks when using a related slicer

I have a filtered measure (see two versions of same measure below)

 

Smartphone % = CALCULATE(
SUM('FW Monthly'[Ad Views]),
'FW Monthly'[Device] IN { "iPhone App" }
)
/ sum('FW Monthly'[Ad Views])

 

Smartphone % =
VAR __BASELINE_VALUE = SUM('FW Monthly'[Ad Views])
VAR __VALUE_TO_COMPARE = [iPhone Views]
RETURN
DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)+1

 

 

When I click on another graphical item that is related to the iphone views metric I get values over 100%!

 

Why would this be?

 

 

6 REPLIES 6
v-danhe-msft
Employee
Employee

Hi @StephenF,

Could you please offer some sample data to have a test if possible?

 

Regards,

Daniel he

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sure,

 

So if i click on an item in a stacked chart of "device by type by ad views" it breaks my % measure in another table...

 

devicetypead views
iphone apppre543
Tablet apppre1234
desktoppre1212
iphone appmid342
Tablet appmid324
desktopmid2
iphone apppost2
Tablet apppost42
desktoppost1

Hi @StephenF,

Could you mean with below measure, the value will above 100%?

Smartphone % =
VAR __BASELINE_VALUE = SUM('FW Monthly'[Ad Views])
VAR __VALUE_TO_COMPARE = [iPhone Views]
RETURN
DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)+1

But I could not get any information about [iphone Views], could you please offer more information? And from your formula, I noticed that you have added a number "1" in the last of your formula, could it will cause your problem?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

[iphone views] or [phone views] is just a filtered measure where ad views is filtered where device = iphone.

 

Heres another version of the calculation that does the same thing without the "+1"

 

Smartphone % =
VAR __BASELINE_VALUE = SUM('FW Monthly'[Ad Views])
VAR __VALUE_TO_COMPARE = [Phone Views]
RETURN
DIVIDE(__VALUE_TO_COMPARE, __BASELINE_VALUE)
 
When I have the below selection selected, I am expecting a value of 100% under the smartphone label to left.
 
As it should be (adviews filtered by slection in right hand chart)/  (adviews filtered by selection in right hand chart)
 
 
%phone.jpg

Hi @StephenF,

From your formula, it seemed work on my side:

1.PNG

Would you please share your pbix file if possible? Also you can test with our sample report on your side.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
StephenF
Responsive Resident
Responsive Resident

bump

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.