cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
srkase Member
Member

MEASURE SHOWING TWO TIMES - COLUMN SHOWING TWO TIMES

111.jpg

 

I have created a matrix and added a measure to find the percentage of spares on product value... the % of spares is showed two times in the matrix...  I want it to be shown only once after the spares value...

 

kindly help me in this regards...

 Thanks in advance,,

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: MEASURE SHOWING TWO TIMES - COLUMN SHOWING TWO TIMES


@srkase wrote:

i am just a beginner in power bi.. can you explain me in detail?


Explain what specifically - changing the measure to return blank if the category is not "spare"?

 

If so, something like the following will do that. Note that the [% of spares] column would still appear for each category in your matrix visual, it will just be blank unless the category is spares.

 

% of Spares =
VAR _products = CALCULATE(
SUM( PROD_CABLE[TOTALVAL]),
PROD_CABLE[CATEGORY] = "PRODUCT"
)
VAR _spares = CALCULATE(
SUM( PROD_CABLE[TOTALVAL]),
KEEPFILTERS(PROD_CABLE[CATEGORY] = "SPARES"),
KEEPFILTERS(PROD_CABLE([MINOR GROUP] in {"outsource","spares","solar","ctrl panel" } )
)
RETURN DIVIDE(_spares, _products) * 100

View solution in original post

6 REPLIES 6
Super User
Super User

Re: MEASURE SHOWING TWO TIMES - COLUMN SHOWING TWO TIMES

This is the expected behaviour. It looks like you have 2 categories selected (PRODUCTS and SPARES) so the matrix control will display every measure in the Values setting for every category.

 

If you only want the value to calculate under spares and would like the column to be blank under products you could wrap the PROD_CABLE[CATEGORY] = "SPARES" in the _spares variable in the KEEPFILTERS() function

srkase Member
Member

Re: MEASURE SHOWING TWO TIMES - COLUMN SHOWING TWO TIMES

i am just a beginner in power bi.. can you explain me in detail?

Super User
Super User

Re: MEASURE SHOWING TWO TIMES - COLUMN SHOWING TWO TIMES


@srkase wrote:

i am just a beginner in power bi.. can you explain me in detail?


Explain what specifically - changing the measure to return blank if the category is not "spare"?

 

If so, something like the following will do that. Note that the [% of spares] column would still appear for each category in your matrix visual, it will just be blank unless the category is spares.

 

% of Spares =
VAR _products = CALCULATE(
SUM( PROD_CABLE[TOTALVAL]),
PROD_CABLE[CATEGORY] = "PRODUCT"
)
VAR _spares = CALCULATE(
SUM( PROD_CABLE[TOTALVAL]),
KEEPFILTERS(PROD_CABLE[CATEGORY] = "SPARES"),
KEEPFILTERS(PROD_CABLE([MINOR GROUP] in {"outsource","spares","solar","ctrl panel" } )
)
RETURN DIVIDE(_spares, _products) * 100

View solution in original post

srkase Member
Member

Re: MEASURE SHOWING TWO TIMES - COLUMN SHOWING TWO TIMES

this works ..

 

Further i am not getting the percentages when the same is drilled down? what could be the reason?

 

Super User
Super User

Re: MEASURE SHOWING TWO TIMES - COLUMN SHOWING TWO TIMES


@srkase wrote:

this works ..

 

Further i am not getting the percentages when the same is drilled down? what could be the reason?

 


I don't understand what you mean here. You'll need to explain in more detail or provide some screenshots. 

srkase Member
Member

Re: MEASURE SHOWING TWO TIMES - COLUMN SHOWING TWO TIMES

did a small change in the keepfilters()...

 

now working fine..

 

thanks dude

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 223 members 2,259 guests
Please welcome our newest community members: