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

Incorrect value in measure when 2 or more filters are selected

I have 3 calculations:

  1. Numerator
  2. Denominator
  3. Percent (By dividing 1 and 2)

 

For the numerator, it displays the correct value (spend amount based on the combination of selected slicers and selected category/axis on the graph, see image below [numerator should be equal to spend amount in card]).

Amount with sleected values in slicer and graphAmount with sleected values in slicer and graph

 

For the denominator, the value it should return is the sum of amount by selected slicer (could be multiple slicer (denominator should be equal to spend amount of selected slicers (release date and/or purchase type)), regardless of what is selected in the bar graph category(axis. )see image:
Amount with SlicerAmount with Slicer

 

When I select a graph the denominator displays the wrong value (denominator should remain 275BN), resulting to wrong percentage. See image:

Wrong Value when graph is selectedWrong Value when graph is selected

 

The correct value for denominator only appears if I only choose one of the slicer (either purchase type or release date). It doesnt work if I choose both.

 

Here's the formula I used for denominator:

 

Denominator =

 

CALCULATE(SUM('Spend Analysis'[PO_Amount]),

 

ALL('Spend Analysis'[Material Group]),

 

ALLSELECTED('Spend Analysis'[Date]))

 

 

 

I also tried this and nothing happened:

 

 

Denominator =

 

CALCULATE(SUM('Spend Analysis'[PO_Amount]),

 

ALL('Spend Analysis'[Material Group]),

 

ALLSELECTED('Spend Analysis'[Date]),

 

ALLSELECTED('Spend Analysis'[Purchase_Type])

 

 

 

18 REPLIES 18
Ashish_Mathur
Super User
Super User

Hi,

Try this

=CALCULATE(SUM('Spend Analysis'[PO_Amount]),ALL('Spend Analysis'[Material Group]))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

still not working,

There seems to be some issue with the relationships.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

i'm only using one table so no relationship was made on my date. I tried everything but nothing work for the function ALL or ALLSELECTED

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Here's the link:
Would really appreciate the help


https://1drv.ms/u/s!Ah4rAyDWhMzAtlWGVcOQKM-LJVNR?e=TzSvgf

 

I am just way too confused.  Just too many visuals there.  I do not know in which visual, what result do you want to see.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi,

 

Please see updated file:

https://1drv.ms/u/s!Ah4rAyDWhMzAtlZAeP-dhqgQG70L?e=DW2WvW

 

Thanks 🙂

Hi,

This one works

Percent Total Spend denominator = 
CALCULATE(SUM('Spend Analysis'[PO_Amount]),ALL('Spend Analysis'[Material_Description]))

When i select a bar in the Material Description graph, the figure for this measure does not change.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

I used the material description as the sample bar graph filter.

Anonymous
Not applicable

Hi,

 

Im reattaching the power bi file

please see link: https://1drv.ms/u/s!Ah4rAyDWhMzAtlWGVcOQKM-LJVNR?e=Am66Oz

 

the denominator still changes when: slicer, release date, and bar graph was selected.

 

Hi,

Use the ALL similarly for all columns which should not impact the calculation.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

i tried that, still don’t work
Anonymous
Not applicable

Hi, please see attach image. Please use percent share (not overall percent share) beside spend amount.

Percent Share = Numerator / Denominator *100 (as seen in the image, numerator card and denominator card).

Data to use.JPG

Material group is the one that im using as a filter (any bar graph below the cards)

Mariusz
Community Champion
Community Champion

Hi @Anonymous 

Try the below.

CALCULATE(
    SUM( 'Spend Analysis'[PO_Amount] ),
    ALLSELECTED()
)
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Anonymous
Not applicable

Hi, this didn't help. It only mimicked the behavior of the numerator.

Hi @Anonymous 

How about this.

Denominator =
CALCULATE(
    SUM( 'Spend Analysis'[PO_Amount] ),
    ALL( 'Spend Analysis' ),
    VALUES( 'Spend Analysis'[Date] ),
    VALUES( 'Spend Analysis'[Purchase_Type] )
)
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Anonymous
Not applicable

it still didn't work once i filtered through bar graph

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.