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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Berrcikk
Frequent Visitor

Calculation to filter Data

Hi all,

 

Currently I'm working on to add additional filters/columns, to provide information how a certain case should be treated.

What I need to do, is to classify a certain case, if it should be open or closed. Let's assume, that today is 24.10.2022. Therefore, all of the records for case A, should be marked as Active, as we have record for todays date. However, for case B, there is no record for today. Therefore all of the cases for case B, should be marked as closed. Please see table below, I think it describes it in the easiest way. Perfectly, it would be to do it in SQL DB, however as I think it's much harder, it is okay to do it in DAX or in M. 

 

Does anyone can help me, how to get the correct syntax? Thanks!

 

CASEDAYIS Case ActiveIS Case closed
a24.10.202210
a23.10.202210
a22.10.202210
b23.10.202201
b22.10.202201

 

Best regards,

Hubert

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Berrcikk,

 

Try these calculated columns:

 

IS Case Active = 
VAR vCase = Table1[CASE]
VAR vToday =
    TODAY ()
VAR vTable =
    FILTER ( Table1, Table1[CASE] = vCase && Table1[DAY] = vToday )
VAR vResult =
    IF ( ISEMPTY ( vTable ), 0, 1 )
RETURN
    vResult
IS Case Closed = IF ( Table1[IS Case Active] = 1, 0, 1 )

 

DataInsights_0-1666877508366.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@Berrcikk,

 

Try these calculated columns:

 

IS Case Active = 
VAR vCase = Table1[CASE]
VAR vToday =
    TODAY ()
VAR vTable =
    FILTER ( Table1, Table1[CASE] = vCase && Table1[DAY] = vToday )
VAR vResult =
    IF ( ISEMPTY ( vTable ), 0, 1 )
RETURN
    vResult
IS Case Closed = IF ( Table1[IS Case Active] = 1, 0, 1 )

 

DataInsights_0-1666877508366.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks! Works out perfectly

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors