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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
irenelitw629
Helper II
Helper II

DAX - VAR Measure help

Hi all,

 

I want to create a calculate measurement with VAR. Whenever account and BU workflow filters are selected, the measure will display corresponding closed amount.

 

Issue: when BU workflow filter is not selected, I expect the value return with total value or be blank. Right now it is not displaying correctly.

 

Example: in attached file, measure is showing $2m when workflow filter is not selected. it should show as $3.5m or blank..

 

Can anyone check what is wrong with my formula:

Measure = VAR _acct = MAXX((Sheet1),Sheet1[Account Name]&'Sheet1'[BU Workflow FY22])
Return
CALCULATE(SUM(Sheet1[USD Closed])
,filter(ALL(Sheet1),
Sheet1[Account Name]&'Sheet1'[BU Workflow FY22]= _acct))

 

Thanks!!

1 ACCEPTED SOLUTION

Hi,

Please check the attached file.

If no-select, then it is blank.

 

 


 

    Microsoft MVP




If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.





LinkedIn
Visit my LinkedIn page





Outlook Booking
Schedule a short Teams meeting to discuss your question.




View solution in original post

7 REPLIES 7
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please try the below measure.

 

Measure: =
VAR _acct =
    MAXX ( Sheet1, Sheet1[Account Name] & 'Sheet1'[BU Workflow FY22] )
RETURN
    IF (
        ISFILTERED ( Sheet1[BU Workflow FY22] ),
        CALCULATE (
            SUM ( Sheet1[USD Closed] ),
            FILTER (
                ALL ( Sheet1 ),
                Sheet1[Account Name] & 'Sheet1'[BU Workflow FY22] = _acct
            )
        )
    )

 

    Microsoft MVP




If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.





LinkedIn
Visit my LinkedIn page





Outlook Booking
Schedule a short Teams meeting to discuss your question.




Hi Kim,

 

Thanks! but it seems not working

 

Can you check the file? maybe it will help you to understnad the issue. https://drive.google.com/file/d/1HEpm7gaq7O4t_4bBNPE5yYFRXIo-T_jh/view?usp=sharing

 

Thanks!

 

Hi,

Please check the attached file.

If no-select, then it is blank.

 

 


 

    Microsoft MVP




If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.





LinkedIn
Visit my LinkedIn page





Outlook Booking
Schedule a short Teams meeting to discuss your question.




Amazing. It works!! Thank you so much Kim!!

 

irenelitw629
Helper II
Helper II

@irenelitw629 , Try if one of two can help

 

Measure = VAR _acct = MAXX((Sheet1),Sheet1[Account Name]&'Sheet1'[BU Workflow FY22])
Return
CALCULATE(SUM(Sheet1[USD Closed])
,filter(ALL(Sheet1), if(isfiltered([BU Workflow FY22]) ,
Sheet1[Account Name]&'Sheet1'[BU Workflow FY22]= _acct) , true()))

 

or

 

Measure = VAR _acct = MAXX((Sheet1),Sheet1[Account Name]&'Sheet1'[BU Workflow FY22])
Return
CALCULATE(SUM(Sheet1[USD Closed])
,filter(ALL(Sheet1), if(isfiltered([BU Workflow FY22]) ,
Sheet1[Account Name]&'Sheet1'[BU Workflow FY22]= _acct) , false()))

 

 

yet to check the file

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

 

Thanks! but it seems not working - can you try the file?

https://drive.google.com/file/d/1HEpm7gaq7O4t_4bBNPE5yYFRXIo-T_jh/view?usp=sharing

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.