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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Calculated column based on date slicer selection

Hi folks,

 

I just read the following article (http://community.powerbi.com/t5/Community-Knowledge-Base/Calculated-Column-Table-Change-Dynamically-...) which makes me believe what I am trying to do is not possible but nevertheless, I'll ask 🙂

 

I have one table (Transactions) with multiple transactions which include 11 columns with different possible manufacturers, a "Total Price" for each line and a transaction date.

 

I have another table (Manufacturer) where I have a distinct list of all manufacturers and I'd like to have against them, a sum of the "Total Price" to plot. The catch is that I'd like to use the Transaction Date of the first table as a slicer, and after hours of trying, I'm close to giving up.

 

At the moment, my calculated column is based on the following:

 

Total Spend = CALCULATE (
SUM(Transactions[TOTAL PRICE]),
FILTER(Transactions,Transactions[Related Manufacturer 1]=Manufacturer[Manufacturer]||Transactions[Related Manufacturer 2]=Manufacturer[Manufacturer]||Transactions[Related Manufacturer 3]=Manufacturer[Manufacturer]||Transactions[Related Manufacturer 4]=Manufacturer[Manufacturer]||Transactions[Related Manufacturer 5]=Manufacturer[Manufacturer]||Transactions[Related Manufacturer 6]=Manufacturer[Manufacturer]||Transactions[Related Manufacturer 7]=Manufacturer[Manufacturer]||Transactions[Related Manufacturer 8]=Manufacturer[Manufacturer]||Transactions[Related Manufacturer 9]=Manufacturer[Manufacturer]||Transactions[Related Manufacturer 10]=Manufacturer[Manufacturer]||Transactions[Related Manufacturer 11]=Manufacturer[Manufacturer]
)
)

Does anyone have any clever idea on how to filter the amount this calculation returns based on a slicer for a date on table1?

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Since a calculated column can't be changed by a slicer, could you consider using measures instead?

 

Best Regards

Maggie

Anonymous
Not applicable

Hi Maggie,

 

Yes completely but I am unable to convert the column formula I have in my first post into a measure? I am effectively testing whether my manufacturer number appears in any of the 11 columns. I also have one column that agreggates all columns (with "//" as a delimeter) but can't integrate a search or find within a measure 😞

Hi @Anonymous

What are your tables like?

I create an example, is it right?

14.png

table1

 

15.png

table2

 

I am testing, if i have misunderstood you, please let me know in time.

 

Best Regards

Maggie

Anonymous
Not applicable

Hello,

 

I have found a solutiuon after reading a new book on PBI 🙂

 

I used the unpivot column function in my original table and duplicated all lines, with one new column showing each singular value.

 

My lookup was then used on this specific column and all functionalities worked.


Thanks everyone and Maggie for your assistance 🙂

 

OF

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.