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! Learn more

Reply
Saddam
New Member

I have wrong in measure with filter based on governorate

I have errror in my measure i use the measure to get last week of dataset and when i call it in matrix table based on governorate the value is inccorrect when i call it in card the total is correct, kindly help me how to solve this issue .

the measure is 

mea= CALCULATE(COUNT(dtable[main_id]),FILTER(dtable,dtable[week]=MAX(dtable[week])))
1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Saddam,

I suppose it should be a multiple aggregate level calculation issues with measure expression, you can refer to Greg’s blog to add a variable with SUMMARIZE function and iterator functions to handle this scenario:

Measure Totals, The Final Word 

mea =
VAR summary =
    SUMMARIZE (
        ALLSELECTED ( dtable ),
        [Category],
        [week],
        "cMain_id", COUNT ( dtable[main_id] )
    )
RETURN
    SUMX ( summary, [cMain_id] )

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

HI @Saddam,

I suppose it should be a multiple aggregate level calculation issues with measure expression, you can refer to Greg’s blog to add a variable with SUMMARIZE function and iterator functions to handle this scenario:

Measure Totals, The Final Word 

mea =
VAR summary =
    SUMMARIZE (
        ALLSELECTED ( dtable ),
        [Category],
        [week],
        "cMain_id", COUNT ( dtable[main_id] )
    )
RETURN
    SUMX ( summary, [cMain_id] )

Regards,

Xiaoxin Sheng

Hi @Anonymous ,

This measure which you have sent is return All values i just need the data of max week to return in matrix table.

Best Regards 

Hi Bro, this measure is return All values i just need the data of max week to return.

Best Regards 

Saddam
New Member

measure in matrix tablemeasure in matrix tablemeasure in cardmeasure in card 

this screenshoot about this problem

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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