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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sms2000
Frequent Visitor

calculated column to filter based on another column

Hi,

I am making a control chart, stdev is based on "d2n" atm .

I have two tables, both are related by "wrk_cde" of datatype text,  

I have created a measure that converts dates to numbers starting from 1 "d2n", 

In Table 2 there is a column "wrk_nm" that is of datatype text and I have a slicer based on this 

upon the slicer selection the "d2n" displays all the points and plots the ones that are related to the selection this causes blank connections in the line chart.

 

I want a measure/ calculated column that returns only the values associated with the slicer selection .

 

*DSN has different values for each day so the new measure/calculated column cannot just return a single value*

2 REPLIES 2
Sahir_Maharaj
Super User
Super User

Hello @sms2000,

 

Can you please try this:

Filtered d2n Sum = 
SUMX(
    RELATEDTABLE(Table2),
    Table2[d2n]
)

Also note that calculated columns are not context-aware in the same way measures are. They are calculated at the time of data refresh and do not change based on slicer selections. So, a calculated column may not be suitable for your requirement if you need dynamic behavior based on slicer selection.

 

Should you have any questions, please do not hesitate to reach out to me.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Hello @Sahir_Maharaj 

 

I forgot to mention "d2n" is in Table 1 and "wrk_nm" is in Table 2,

I have tried creating a measure but the x-axis for a line chart does not accept measures. 

how shall I proceed with this?

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors