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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Naveen_BN
Frequent Visitor

DAX measure to show all 100% Brick share, only 90% Brick share and only 50 % Brick share

Hi All,

 

I need to show the Bricks with 100% share, only 90% share and only 50 %  share in the column chart based on the selection by using 100%, 90% and 50% button or parameter.

How to achive that using dax measure. 

Please find the below requirment

Naveen_BN_0-1668313022609.png

 

Thanks in Advance

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Naveen_BN ,

Please refer to my pbix file to see if it helps you.

Create a measure.

Measure = var _1= CALCULATE(SUM('Table'[Mark Share]),FILTER(ALL('Table'),'Table'[Index]<=SELECTEDVALUE('Table'[Index])))
var _selected=SELECTEDVALUE('Table (2)'[value])
return
IF(_selected>=_1,1,0)

vpollymsft_0-1669363314876.pngvpollymsft_1-1669363324239.png

Best Regards

Community Support Team _ Polly

 

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

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @Naveen_BN ,

Please refer to my pbix file to see if it helps you.

Create a measure.

Measure = var _1= CALCULATE(SUM('Table'[Mark Share]),FILTER(ALL('Table'),'Table'[Index]<=SELECTEDVALUE('Table'[Index])))
var _selected=SELECTEDVALUE('Table (2)'[value])
return
IF(_selected>=_1,1,0)

vpollymsft_0-1669363314876.pngvpollymsft_1-1669363324239.png

Best Regards

Community Support Team _ Polly

 

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

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1668317052633.png

 

Sales measure: = 
SUM(Data[Sales])

 

Sales ratio: = 
VAR _salesall =
    CALCULATE ( [Sales measure:], ALL ( Data[Bricks] ) )
VAR _bricksales = [Sales measure:]
VAR _ratio =
    DIVIDE ( _bricksales, _salesall )
RETURN
    _ratio

 

Selected Sales ratio cumulate: =
VAR _selected = [TopNPercent Value]
VAR _ratio = [Sales ratio:]
VAR _cumulate =
    FILTER (
        ADDCOLUMNS ( ALL ( Data[Bricks] ), "@ratio", [Sales ratio:] ),
        [@ratio] >= _ratio
    )
VAR _cumulateratio =
    SUMX ( _cumulate, [@ratio] )
RETURN
    IF ( _cumulateratio <= _selected, _cumulateratio )

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Thanks the solution, But i need the sum of 90% like, Brick 1= 12%, Brick 2 = 10,.... Total(90%)

This should be shown in indivdual rows.

 

Thanks in advance

 

 

Hi,

I am not sure how your desired outcome looks like, but please check the attached pbix file.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hi Kim, Thanks for the update, I need the columns like below based on the selection.

 

Naveen_BN_0-1668427991941.png

Thank you in advance

Hi,

Thank you for your feedback.

Sorry that I do not understand the difference between your last request and my last updated pbix file.

Could you please check the attached pbix file again? When you select top 90 % from the slicer, it shows the correct visualization. When you select top 50% from the slicer, it shows the correct visualization.

Could you please kindly let me know which part is not correct or which part do you want to change in the attached pbix file?

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hi Kim,

 

Thanks for the reply, total is not coming valid as 100% with cumulation. 

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.