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
newbie9292
Helper II
Helper II

Measure calculation not following the selected filter

Hello,

 

I have two measure in my report which should follow the selected value in the page level filter. But for some reason its not working as expected. For example in the below visual eventhough I have selected 2023 it still shows the data for 2022. This only happens when I include the measures in my table visual.

newbie9292_0-1676492420622.png


I have few parameter inputs from the user (these parameter do not have any relationship with my data tables).
This is how my measures look

Scenario Category Measure =
VAR UserInputLow = VALUE(InputLow[InputLow Value])
VAR UserInputHigh = VALUE(InputHigh[InputHigh Value])
VAR SelectedYear = SELECTEDVALUE('dateTable'[Date].[Year])
VAR OGChance = CALCULATE(SUM('MyTable1'[Chance in %]), YEAR('MyTable1'[Datum]) = SelectedYear)
RETURN
    SWITCH(TRUE(),
        OGChance <= UserInputLow, "Low [<= " & UserInputLow & "%]",
        AND(OGChance > UserInputLow, OGChance < UserInputHigh), "Medium [>" & UserInputLow & "% & < " & UserInputHigh & "%]",
        OGChance >= UserInputHigh,  "High [>= " & UserInputHigh & "%]"
    )

Custom_Gewichtet_Betrag_chance =
VAR Betrag = SUM('MyTable1'[Betrag])
VAR SelectedYear = SELECTEDVALUE('dateTable'[Date].[Year])
VAR OGchance= CALCULATE(SUM('MyTable1'[Chance in %]), 'dateTable'[Date].[Year] = SelectedYear)
VAR ThresholdHigh = VALUE(InputHigh[InputHigh Value])
VAR ThresholdLow = VALUE(InputLow[InputLow Value])
VAR CustomHighChance = VALUE('Custom Chance High'[Custom Chance High Value])
VAR CustomMedChance = VALUE('Custom Med Chance'[Custom Med Chance Value])
VAR CustomLowChance = VALUE(Custom_Chance_Low[Custom_Chance Value])
RETURN
SWITCH(TRUE(),
  INT(OGchance) <= INT(ThresholdLow), CustomLowChance,
  INT(OGchance) >= INT(ThresholdHigh), CustomHighChance,
  INT(OGchance)>INT(ThresholdLow) && INT(OGchance)<INT(ThresholdHigh),CustomMedChance
)

So my final wish is to replace the original weights (Chance in %) with the user provided weights(CustomHigh,CustomLow etc.)
Can someone please help me?

3 REPLIES 3
newbie9292
Helper II
Helper II

Can someone please help me with this?
Would really appreciate any help.

MURTAZA
Resolver I
Resolver I

Could you confirm the cardinality between your date and fact table?

Hello @MURTAZA 
It's Many to One

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.