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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
JohnTwohig
New Member

Items used during a particular period

I have a fact table like below that shows a colour and when it started and ended. I want to pick a period and get a list of all colours used in that period. So Red began being used in period 1 and was used until period 5. A blank End means it is still being used.

Field1StartEndValue
Red151
Blue241
Green131
Orange3 1
Black1 1

 

My dimension table has an active relationship from DimField2 to Start and an inactive relationship to End.

DimField1DimField2
One1
Two2
Three3
Four4
Five5

 I want to be able to choose a DimField1 and only see records used in that period. So, if I choose Four, I would get Red, Blue, Orange, Black.

I have a measure that gives me how many were used in each period but I can't figure out how to get which ones they are. Any suggestions?

1 ACCEPTED SOLUTION
techies
Super User
Super User

Hi @JohnTwohig please try this

 

IsActiveInPeriod =
VAR SelectedPeriod =
    SELECTEDVALUE ( DimTable[DimField2] )
VAR StartValue =
    CALCULATE ( MIN ( Fact[Start] ), ALL ( DimTable ) )
VAR EndValue =
    CALCULATE ( MIN ( Fact[End] ), ALL ( DimTable ) )
RETURN
IF (
    NOT ISBLANK ( SelectedPeriod ) &&
    StartValue <= SelectedPeriod &&
    ( ISBLANK ( EndValue ) || EndValue >= SelectedPeriod ),
    1,
    0
)
 
Recording 2025-08-15 144859.gif

 

 

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

View solution in original post

5 REPLIES 5
v-echaithra
Community Support
Community Support

Hi @JohnTwohig,

Thank you @techies , @Greg_Deckler for your inputs.

We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.

Thank you for your patience and look forward to hearing from you.

Best Regards,
Chaithra E.

techies
Super User
Super User

Hi @JohnTwohig please try this

 

IsActiveInPeriod =
VAR SelectedPeriod =
    SELECTEDVALUE ( DimTable[DimField2] )
VAR StartValue =
    CALCULATE ( MIN ( Fact[Start] ), ALL ( DimTable ) )
VAR EndValue =
    CALCULATE ( MIN ( Fact[End] ), ALL ( DimTable ) )
RETURN
IF (
    NOT ISBLANK ( SelectedPeriod ) &&
    StartValue <= SelectedPeriod &&
    ( ISBLANK ( EndValue ) || EndValue >= SelectedPeriod ),
    1,
    0
)
 
Recording 2025-08-15 144859.gif

 

 

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

@techies 

That works exactly how I wanted. 

 

Thanks 

Greg_Deckler
Community Champion
Community Champion

@JohnTwohig Remove your relationships and use this measure:

Measure = 
    VAR __DimField2 = MAX( 'DimTable'[DimField2] )
    VAR __Table = 
        FILTER( 
            ADDCOLUMNS(
                ALL( 'Table' ), 
                "__End", IF( [End] = BLANK(), 5, [End] )
            ),
            [Start] <= __DimField2 && [__End] >= __DimField2 
        )
    VAR __Result = CONCATENATEX( __Table, [Field1], ", " )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks for the suggestion. It didn't quite give what I wanted because I couldn't filter out the unwanted rows but The result was interesting and will probably be useful in a slightly different use case.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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