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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Get the MAX SUM except for this data

Previously I had an issue that @Zubair_Muhammad solved here : https://community.powerbi.com/t5/Desktop/Matrix-Total-in-a-measure-doesn-t-sum-up/m-p/729524#M352008

 

I needed to get the max sum value from differents sources but having the total sum not as the MAX(SUM()) but the SUM of the returned data.

 

For that I added a first measure

InscriptionMeasure = 
MAX (
    SUM ( 'Prod Asso Inscrites OnLine'[Inscription Prod] ),
    SUM ( 'GA Asso Inscrites OnLine'[Associations Inscrites] )
)

Then from that I added a second one that I used in my matrix:

Inscription = 
IF (
        HASONEFILTER ( 'Canaux Online'[Canaux Online] ),
        [InscriptionMeasure],
        SUMX ( VALUES ( 'Canaux Online'[Canaux Online] ), [InscriptionMeasure] )
)

Now I need to had another IF inside this logic.

I want the exacte same result except if the column is "Canaux Online" = "SMO" I need to had the SUM coming from Another table.

 

PBI_SUM_SMO.png

 

I try differente solution but I cannot make this work. Any idea how ?

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try this modification

 

Inscription =
IF (
    HASONEFILTER ( 'Canaux Online'[Canaux Online] ),
    [InscriptionMeasure],
    SUMX (
        EXCEPT ( VALUES ( 'Canaux Online'[Canaux Online] ), { "SMO" } ),
        [InscriptionMeasure]
    )
)

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Thank you @Zubair_Muhammad 

It doesn't seem to do anything.

 

Also even if I can exclude the SMO part, how can I add in place the SUM from the other source ?

HI, @Anonymous 

It should work well, if you want conditional from other source, you could try this way

Inscription 33 = 
IF (
    HASONEFILTER ( 'Canaux Online'[Canaux Online] ),
    [InscriptionMeasure],
    SUMX (
        EXCEPT ( VALUES ( 'Canaux Online'[Canaux Online] ), VALUES('other source'[Canaux Online]) ),
        [InscriptionMeasure]
    )
)

if possible, please share a simple sample pbix file for us have a test.

You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Best Regards,

Lin

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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