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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
milomilo2020
Frequent Visitor

Calculated column filtered by Date from another table

HI, I have this calculated column in a table:

 

 

Calculated column = 

var total_nonbreaches = 
CALCULATE(
    DISTINCTCOUNT(Issues[Key]),
    Issues[Time to first response: Breached?] = "false")

var total_breaches = 
CALCULATE(
    DISTINCTCOUNT(Issues[Key]),
    Issues[Time to first response: Breached?] = "true")

var total = total_breaches+total_nonbreaches 
var final = IF(DIVIDE(total_nonbreaches,total) = 0, 1.00, DIVIDE(total_nonbreaches,total))
 return 

final

 

 

 

The "Issues" table (Fact table) is connected to this table by "Company Code" and also has a "Date" column.

I need to use this "Date" column from "Issues" table to filter the Calculated column when I put it on KPI's.

 

So my goal is to add this "Date" filter into the DAX, so when I create a KPI with the Calculated column, I can filter by "Date"

milomilo2020_0-1649166486212.png

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@milomilo2020 , if you need to join on two-column, then you should create concatenated column both side and join

 

key  = [Company] & "-" & format([Date], "YYYYMMDD")

 

But you need move data from one table to another you can use

new column in table 1  example

sumx(filter( Table2 , Table1[company] = table2[Company] && Table1[date] = table2[date] ), Table2[Value])

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@milomilo2020 , if you need to join on two-column, then you should create concatenated column both side and join

 

key  = [Company] & "-" & format([Date], "YYYYMMDD")

 

But you need move data from one table to another you can use

new column in table 1  example

sumx(filter( Table2 , Table1[company] = table2[Company] && Table1[date] = table2[date] ), Table2[Value])

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.