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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Razan_Omoush
Frequent Visitor

Calculated table using a measure to calculate data based on a slicer .

I created a measure to calculate an amount based on multiple conditions, including one that calculates the amount for a specific period using a date slicer. However, when I apply an additional slicer to filter data based on a specific value (for example, from the "Policy" dimension table), the measure returns a blank result. If I use the measure without any slicers on the dimension tables, the amount calculates correctly as shown in the images below. It seems like the problem is in the variable "Above Zero". Is there any solution for this. Thank you in advance.

-------------

OSAmountnot13 =
 VAR MAX_DATE = LASTDATE('Date'[Date])
 VAR AboveZero = SELECTCOLUMNS(
            FILTER(
                CALCULATETABLE(
                    SUMMARIZE(
                        'FACT',
                        'FACT'[CLAIM_ID],
                        "Amount", SUM('FACT'[OS_AMOUNT])
                    ),
                    FILTER(
                        'FACT',
                        'FACT'[UW_DATE] <= MAX_DATE
                    ),
                    FILTER(
                        'FACT',
                        'FACT'[OVERRIDE_STATUS] <> "13"
                    ),
                    FILTER(
                        'FACT',
                        'FACT'[BENEFIT_TYPE] = 1
                    )
                ),
                [Amount] > 0
            ),
            "CLM_ID", 'FACT'[CLAIM_ID]
        )

        VAR MED_os_not_13 = CALCULATE(
            SUM('FACT'[os_amount]),
            'FACT'[UW_DATE] <= MAX_DATE,
            REMOVEFILTERS('FACT'[UW_DATE]),
            NOT ('FACT'[OVERRIDE_STATUS] = "13"),
            'FACT'[BENEFIT_TYPE] = 1,
            'FACT'[CLAIM_ID] IN AboveZero
        )

        RETURN
            MED_os_not_13

-----------------

 

 

image.pngimage.png

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with, explain the question and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


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

Hi @Razan_Omoush ,

Based on the description, None of your expressions involve the policy_no column in the slicer visual, is there a relationship between the policy table and the fact table? So, try to check the relationship and use ALLSELECTED to remove filter.

 

Best Regards,

Wisdom Wu

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

shashidhar
Frequent Visitor

Try this 
OSAmountnot13 =
VAR MAX_DATE = LASTDATE('Date'[Date])
VAR AboveZero = SELECTCOLUMNS(
FILTER(
CALCULATETABLE(
SUMMARIZE(
'FACT',
'FACT'[CLAIM_ID],
"Amount", SUM('FACT'[OS_AMOUNT])
),
'FACT'[UW_DATE] <= MAX_DATE,
'FACT'[OVERRIDE_STATUS] <> "13",
'FACT'[BENEFIT_TYPE] = 1
),
[Amount] > 0
),
"CLM_ID", 'FACT'[CLAIM_ID]
)

VAR MED_os_not_13 = CALCULATE(
SUM('FACT'[os_amount]),
'FACT'[UW_DATE] <= MAX_DATE,
'FACT'[OVERRIDE_STATUS] <> "13",
'FACT'[BENEFIT_TYPE] = 1,
'FACT'[CLAIM_ID] IN AboveZero,
REMOVEFILTERS('FACT'[UW_DATE]), -- To avoid conflicts with date slicer
REMOVEFILTERS('Policy') -- To handle slicer interaction
)

RETURN
MED_os_not_13

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors