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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Pwc_PaK
Regular Visitor

All Function for certain condition

Dax to get data from the version 1 when there is not other version row in the table based on the selected profit center.

MTD Actual Balance
2 =
VAR max_period_num = CALCULATE(MAX('MF4-MFG-PBQ'[PERIOD_NUM]))
VAR max_fiscal_year = MAX('MF4-MFG-PBQ'[FISCAL_YEAR])

VAR result =
    CALCULATE(
        SUM('MF4-MFG-PBQ'[Balance]),
        'MF4-MFG-PBQ'[PERIOD_NUM] = max_period_num,
        'MF4-MFG-PBQ'[FISCAL_YEAR] = max_fiscal_year,
        REMOVEFILTERS('MF4-MFG-PBQ'[Version.Version Level 01.Key]),
    if(
      CALCULATE(COUNTROWS('MF4-MFG-PBQ'),
     'MF4-MFG-PBQ'[Version.Version Level 01.Key]<>"1")=0,
     ALL('MF4-MFG-PBQ'[Profit Center.Level 03]),
     ALLSELECTED('MF4-MFG-PBQ'[Profit Center.Level 03])
       ),
        'MF4-MFG-PBQ'[Version.Version Level 01.Key]="1"
    )
RETURN result

dax is in error need help
3 REPLIES 3
QuentinBl
Helper I
Helper I

Hello @Pwc_PaK , it will be really difficult to help you without more precise context. To test your measure, we need the dataset or at least, the error you get.

Hi @QuentinBl  thank you for replying , i have attached the screenshot of report.
You can see in the table V1 is version and one of profit center 03 is not having versions other than 1 
so in this case if one profit center don't have version and user select the version from slicer data should not be filters to that version only. it should give the rows which don't have version including the selected version data.

Pwc_PaK_1-1711472906711.png

 

 

Anonymous
Not applicable

Hi, @Pwc_PaK 

As @QuentinBl  mentions, it is not possible to simulate your data based on the information you have provided, you need to provide pbix files without sensitive data or information that can simulate your datasheets, Measure, and the effect you are expecting.

Best Regards,
Yang
Community Support Team




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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