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
AliceW
Power Participant
Power Participant

ALLSELECTED(), but with one exception? Is this sorcery possible?

Hello everyone,

I have this big table and I created one measure to get the % from total.

From Total =

divide(

   [Amount],
    calculate([Amount],ALLSELECTED()
))
However, I have this Date table, whose column Year I use in a matrix.
I'd like the % to be 100% for each year.
At the moment, I get 100% for all years.
 
The expected result:
Value20222023
Fruits45%30%
Vegs55%70%
Total100%100%
 
Does anyone know how to solve this, please?
Thanks,
Alice
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AliceW ,

Please try this:

From Total = 
DIVIDE(
    [Amount],
    CALCULATE([Amount], ALLSELECTED(),VALUES('Calendar'[Year]))
)

vcgaomsft_0-1696235936273.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @AliceW ,

Please try this:

From Total = 
DIVIDE(
    [Amount],
    CALCULATE([Amount], ALLSELECTED(),VALUES('Calendar'[Year]))
)

vcgaomsft_0-1696235936273.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Thank you so much, Gao! It works great!

AliceW
Power Participant
Power Participant

Hi Sergej,

I'd like that each Year column gets its own 100%.

Like you get when displaying an amount as '% of column total'. Yes, this is the best example. The only reason why I'm NOT using this solution is because I'm bringing this measure into a Switch measure later on.

I hope it's clear and you can find a solution :0)

Thank you for reading,
Alice

Hey Alice,
like this, right?

sergej_og_0-1696235981861.png

If yes, try this:

% Part = 
VAR SalesCategory = 
    CALCULATE(
        [your_SUM_measure],
        ALLSELECTED(yout_table[Category])
    )

RETURN
DIVIDE([your_SUM_measure], SalesCategory)


Regards
Sergej

 

sergej_og
Super User
Super User

Hey Alice,
not clear to me what is your target layout.
What result would you like achieve?

Can you pls provide a Screen with your target and discription to that.

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