cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nimp_kp
Frequent Visitor

Blank data if one category of sales accounts for 100% of sales in a month

Hi

 

As the title says, I'm trying to create a measure that blanks out all sales data in a month if only one product category has 100% of the sales. Dropbox link with sample file at the bottom.

 

In the below picture, all sales in month 1 is vegetable only, so i want month 1 to not show any data in the chart

nimp_kp_0-1623318457301.png

Month 2 is fine, as there are sales across multiple categories.

nimp_kp_1-1623318587922.png

 

Any help is appreciated.

 

Sample pbix included:

https://www.dropbox.com/s/vsqixjb2q7zy4cd/Sample.pbix?dl=0

1 ACCEPTED SOLUTION
PaulOlding
Solution Supplier
Solution Supplier

Here's a measure that will check how many categories there are and only return the amount when there's more than 1.

 

Amount measure =
VAR _NumCategories =
CALCULATE(
COUNTROWS(VALUES(Ark1[Category])),
REMOVEFILTERS(Ark1[Category])
)
VAR _Result =
IF (_NumCategories > 1,
SUM(Ark1[Amount]),
BLANK()
)
RETURN
_Result

 

View solution in original post

1 REPLY 1
PaulOlding
Solution Supplier
Solution Supplier

Here's a measure that will check how many categories there are and only return the amount when there's more than 1.

 

Amount measure =
VAR _NumCategories =
CALCULATE(
COUNTROWS(VALUES(Ark1[Category])),
REMOVEFILTERS(Ark1[Category])
)
VAR _Result =
IF (_NumCategories > 1,
SUM(Ark1[Amount]),
BLANK()
)
RETURN
_Result

 

View solution in original post

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors