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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jasonwq
Helper I
Helper I

Filtering within a measure or column

Hi. I was wondering if I can filter within a measure or a column without affecting the entire visual?

 

ENTRY_TYPEQUANTITY
Sale-8
Purchase50
Consumption-15
Output13

 

In the above table, let's say I'd like to essentially end up with something like this:

ENTRY_TYPEQUANTITYSALESPURCHASECONSUMPTIONOUTPUT
Sale-8-8000
Purchase5005000
Consumption-1500-150
Output1300013

 

That way I could retrieve my SUM(table[SALES]) without Filtering the entire visual by ENTRY_TYPE by SALES.

 

Is that possible?

1 ACCEPTED SOLUTION

Hi @jasonwq 

I think you currently build four calculated columns as below.

Sales,Purchase Consumption and Output's Format looks the same.

 ... = if(ItemLedgerEntries[Entry_Type] = "...", ItemLedgerEntries[Quantity])

In addition to  , here I will show you how to build a new table to achieve your goal.

Build a new table by dax code.

DIM_ENTRY_TYPE = VALUES('Table'[ENTRY_TYPE])

Build a relationship between two tables.

1.png

Build a measure.

SUM QTY = SUM('Table'[QUANTITY])+0

Matrix is as below.

1.png

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
amitchandak
Super User
Super User

@jasonwq , You can create one more table with distinct value ENTRY_TYPE and join it with ENTRY_TYPE. And then use both ENTRY_TYPE on matrix. And use sum Quantity, Grand total should show what you have in Quantity in second visual

@amitchandak 

I used

New Column = if(ItemLedgerEntries[Entry_Type] = "Sale", ItemLedgerEntries[Quantity])

 

Thanks for your help but I don't know how to utilize NewTable. 

Hi @jasonwq 

I think you currently build four calculated columns as below.

Sales,Purchase Consumption and Output's Format looks the same.

 ... = if(ItemLedgerEntries[Entry_Type] = "...", ItemLedgerEntries[Quantity])

In addition to  , here I will show you how to build a new table to achieve your goal.

Build a new table by dax code.

DIM_ENTRY_TYPE = VALUES('Table'[ENTRY_TYPE])

Build a relationship between two tables.

1.png

Build a measure.

SUM QTY = SUM('Table'[QUANTITY])+0

Matrix is as below.

1.png

Best Regards,
Rico Zhou

 

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

 

But then the data will not update with my system, correct? The new table will not be a Live database.

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.