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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AleGuty04
Frequent Visitor

Is there a way to make DAX based of a value in a visual card?

Hello everyone;

I'm trying to build a DAX formula in which I can calculate the fines (if, ot: [types of fines]) by month wether I select week 20 or week 21 I should be able to still see the calculations per month. My data in the fact table is currently set up for calendar weeks and its joined to a date dim table in which it has the months corresponding per week called Month Year:

AleGuty04_0-1691616065870.png


Here's the current DAX formula i'm using:

 

IF Fines Monthly Dax = 
    CALCULATE(
        var table1=
            SUMMARIZE(
                'OTIF Customer Vendor',
                'OTIF Customer Vendor'[customer_vendor_num],
                "calc",
                    IF([Montlhy IF % DAX] >= .98, 0, CALCULATE(SUM('OTIF'[if_fines]))))
        return 
            CALCULATE(SUMX(table1,[calc]))
    , ALL('OTIF'[calendar_week]))

 

Everything works just fine, except for the last calculate function in which I have to add a second slicer for the month to make it work, but ideally its to have it work just with the calendar_week slicer doing the calculation per month :

AleGuty04_1-1691616863748.png

Do you have any ideas in how to do that?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AleGuty04 ,

Please have a try.

IF Fines Monthly Dax =
CALCULATE (
    VAR table1 =
        SUMMARIZE (
            'OTIF Customer Vendor',
            'OTIF Customer Vendor'[customer_vendor_num],
            'Date Dim'[Month Year],
            "calc", IF ( [Montlhy IF % DAX] >= .98, 0, CALCULATE ( SUM ( 'OTIF'[if_fines] ) ) )
        )
    RETURN
        CALCULATE ( SUMX ( table1, [calc] ), ALL ( 'Date Dim'[Month Year] ) ),
    ALL ( 'OTIF'[calendar_week] )
)

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

1 REPLY 1
Anonymous
Not applicable

Hi @AleGuty04 ,

Please have a try.

IF Fines Monthly Dax =
CALCULATE (
    VAR table1 =
        SUMMARIZE (
            'OTIF Customer Vendor',
            'OTIF Customer Vendor'[customer_vendor_num],
            'Date Dim'[Month Year],
            "calc", IF ( [Montlhy IF % DAX] >= .98, 0, CALCULATE ( SUM ( 'OTIF'[if_fines] ) ) )
        )
    RETURN
        CALCULATE ( SUMX ( table1, [calc] ), ALL ( 'Date Dim'[Month Year] ) ),
    ALL ( 'OTIF'[calendar_week] )
)

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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
Users online (4,531)