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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
PKostta
Regular Visitor

Monthly values and ALLEXCEPT

Hi,

 

I'm trying to get the monthly values for a measure i created but it only shows the total for every month. If i remove the ALLEXCEPT condition it works fine.

 

Example:

 Measure with ALLEXCEPTMeasure without ALLEXCEPT
2023-Jan20050
2023-Feb200150
Total200200

 

Measure: 

v_Count_CLCL_ID_BASE = CALCULATE(DISTINCTCOUNT(RAID_ClaimsDrivers_LINE[CLCL_ID])
    , FILTER(ALL(RAID_ClaimsDrivers_MEME), RAID_ClaimsDrivers_MEME[CALC_SEGMENTO]="INDIVIDUAL" || RAID_ClaimsDrivers_MEME[CALC_SEGMENTO]="MICROS" || RAID_ClaimsDrivers_MEME[CALC_SEGMENTO]="TAILOR MADE")
    , FILTER(ALL(RAID_ClaimsDrivers_MEME), RAID_ClaimsDrivers_MEME[CALC_REDE]="MED1")  
    , FILTER(ALLEXCEPT(RAID_ClaimsDrivers_CLCL, RAID_ClaimsDrivers_CLCL[COBERTURA], RAID_ClaimsDrivers_CLCL[Cobertura_Filter]), RAID_ClaimsDrivers_CLCL[CLCL_PAY_PR_IND]="P")    
)

 

What can i change in order to work properly?

 

Kind regards,

Pedro

 

 

1 REPLY 1
v-tangjie-msft
Community Support
Community Support

Hi @PKostta ,

 

Please try this:

v_Count_CLCL_ID_BASE = CALCULATE(
    DISTINCTCOUNT(RAID_ClaimsDrivers_LINE[CLCL_ID]),
    FILTER(
        ALL(RAID_ClaimsDrivers_MEME),
        RAID_ClaimsDrivers_MEME[CALC_SEGMENTO] = "INDIVIDUAL"
            || RAID_ClaimsDrivers_MEME[CALC_SEGMENTO] = "MICROS"
            || RAID_ClaimsDrivers_MEME[CALC_SEGMENTO] = "TAILOR MADE"
    ),
    FILTER(
        ALL(RAID_ClaimsDrivers_MEME),
        RAID_ClaimsDrivers_MEME[CALC_REDE] = "MED1"
    ),
    KEEPFILTERS(
        FILTER(
            ALL(RAID_ClaimsDrivers_CLCL[COBERTURA], RAID_ClaimsDrivers_CLCL[Cobertura_Filter]),
            RAID_ClaimsDrivers_CLCL[CLCL_PAY_PR_IND] = "P"
        )
    )
)

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Kudoed Authors