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
prebenolsen
Regular Visitor

Filter a date table with rows that have a value on January

Hi, 

 

I'll try to better explain the title here:

I have a dataset as you can see below (sample). 

I want to create a visual (barchart, table) shows the frequency of positive and negative for each month, for each ID.

The visual should only include rows that have a value in January. 

 

In the sample data, ID 1 and 2 both have values for January. ID 3 does not.

The visual should exclude ID 3, and present ID 1 and 2s positive and negative values for all months. 

 

IDMonthPositiveNegative
1January45
1February54
1March73
1April102
2January77
2February83
2March101
2April121
3February55
3March54

 

Is there an easy way of doing this, or is complex DAX required? 

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @prebenolsen,

I have a solution here:

tomfox_0-1644957398506.png

 

I created a calcualted column so I could use it in the visual as a filter:

tomfox_1-1644957452962.png

 

tomfox_2-1644957513412.png

 

The code is as follows:

IDContainsJanuaryFilter = 
VAR _list = 
    SUMMARIZE (
        FILTER (  Table12, Table12[Month] = "January"  ),
        [ID]
    )
RETURN
IF ( Table12[ID] IN _list, 1, 0 )


Does this work for you? 🙂

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom

 

 

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

1 REPLY 1
tackytechtom
Super User
Super User

Hi @prebenolsen,

I have a solution here:

tomfox_0-1644957398506.png

 

I created a calcualted column so I could use it in the visual as a filter:

tomfox_1-1644957452962.png

 

tomfox_2-1644957513412.png

 

The code is as follows:

IDContainsJanuaryFilter = 
VAR _list = 
    SUMMARIZE (
        FILTER (  Table12, Table12[Month] = "January"  ),
        [ID]
    )
RETURN
IF ( Table12[ID] IN _list, 1, 0 )


Does this work for you? 🙂

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom

 

 

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

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.