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
avulasandeep
Helper III
Helper III

how many products got selected percentage sales

Hi PowerBI experts,

 

i need the products for the selected percentage.

 

Here is the detail description for the requirement.

 

 

 

how many products had  more than 50 Percentage.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This is fine example for explanation:

how many products had 100 Percentage.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Here i kept 2 examples

From First pic : The selecting percentage when i select more than 50% i Need only more than 50% Selected Products only and

Second Pic : if i select percentage less than 100 i need only the products for less than 100% .

 

Is this possible in DAX??? Please Let me know .

 

Hope it will work out with DAX please help me out its very important.

 

 

 

Thanks

ASKumar

 

 

 

 

 

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @avulasandeep 

1.Create a what-if parameter

2.png

This will get a table named "Parameter" with a column "Parameter" and a measure "Parameter Value",

 

2.enter data to get a table "more/less"

3.png

Note: don't create any relationships among these two created tables with your main table.

Then add "more/less" column and "parameter" column in two slicers.

 

3.create measures in your main data table (sheet1 in my test)

More_OR_less = IF(SELECTEDVALUE('more/less'[more/less])="More than",1,0)

selected_per = [Parameter Value]

condition = 
SWITCH(TRUE(),[More_OR_less]=1&&SUM(Sheet1[value])>[Parameter Value],1,[More_OR_less]=0&&SUM(Sheet1[value])<[Parameter Value],0)

4.png

Finally, after adding columns in the matrix as above, click on the triangle icon of the "value" field, select "conditional formatting"->font color,

in the setting above, select "color based on rule"->select the "condition" measure.

 

If you want to values which meet the condition to show otherwise not show, you could create another measure and color the value based on this measure

condition2 = 
SWITCH(TRUE(),([More_OR_less]=1&&SUM(Sheet1[value])>[Parameter Value])||([More_OR_less]=0&&SUM(Sheet1[value])<[Parameter Value]),1,0)

5.png

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
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

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @avulasandeep 

1.Create a what-if parameter

2.png

This will get a table named "Parameter" with a column "Parameter" and a measure "Parameter Value",

 

2.enter data to get a table "more/less"

3.png

Note: don't create any relationships among these two created tables with your main table.

Then add "more/less" column and "parameter" column in two slicers.

 

3.create measures in your main data table (sheet1 in my test)

More_OR_less = IF(SELECTEDVALUE('more/less'[more/less])="More than",1,0)

selected_per = [Parameter Value]

condition = 
SWITCH(TRUE(),[More_OR_less]=1&&SUM(Sheet1[value])>[Parameter Value],1,[More_OR_less]=0&&SUM(Sheet1[value])<[Parameter Value],0)

4.png

Finally, after adding columns in the matrix as above, click on the triangle icon of the "value" field, select "conditional formatting"->font color,

in the setting above, select "color based on rule"->select the "condition" measure.

 

If you want to values which meet the condition to show otherwise not show, you could create another measure and color the value based on this measure

condition2 = 
SWITCH(TRUE(),([More_OR_less]=1&&SUM(Sheet1[value])>[Parameter Value])||([More_OR_less]=0&&SUM(Sheet1[value])<[Parameter Value]),1,0)

5.png

 

Best Regards

Maggie

 

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

v-juanli-msft
Community Support
Community Support

Hi @avulasandeep 

Let me confirm your requirement:

You have a slicer listing "more than 50%, less than 100%,...ect"

 

In the first picture, you select "more than 50%" from the slicer, then only value which percent is more than 50% is colored by "yellow",other values remains default style.

 

In the second picture, you select "less than 100%" from the slicer, then only value which percent is less than 100% shows on the bar chart, other values doesn't show on the visual.

 

Is my understanding right?

 

Best Regards

Maggie

 

Hi @v-juanli-msft

Sorry for confusing the above pic , here I need any one from slicer which I need for example if I select less than 20% the output should be like percentages have to present display less than 20% and

Suppose if l select 30 % means the output should display only 30% sales only ..... similarly, if I need more than 50% means the output should be like more than 50% only . 50>
Hope understood...pls let me know any questions.

Thanks
Sandeep

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.