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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
suchomelb
Helper I
Helper I

Specifying date range used for SWITCH

I've tried a few options like datesbetween with min and max date but I keep getting errors. I thought this wouldn't be as difficult as its proving to be.

I have a table with a date column and a parameter column that can switch out employee, manager, or nothing. Problem is when I have it just by date, when combined with the measure below, I am seeing everything in my date table. My data starts on March 1st but of course the date table is going back to Jan 1st. I want to only show from my min date to my max date in the date column of my main table. How would I acheive this?

 

Measure used in column: 

Test =
    SWITCH([Added marks], 0, "🔵", 1, "🟡",2, "🟠", 3, "🔴")

In case it matters, measure used for the SWITCH measure:
Added marks =
VAR Cond1 =
    IF ( [#Avg 1] > 1000, 1, 0 )
VAR Cond2 =
    IF ( [#Avg 2] > 800, 1, 0 )
VAR Cond3 =
    IF ( [#Avg 3] > 100, 1, 0 )
VAR AddedUp = ( Cond1 + Cond2 + Cond3 )
RETURN
    AddedUp
 
1 ACCEPTED SOLUTION
suchomelb
Helper I
Helper I

Figures i'd figure it out shortly after posting. I just put an IF statement before the SWITCH to get rid of any rows where one of my columns is greater than 0, thus removing everything where dates dont have data or any dates in between my date range that were empty, which it was grabbing as well.

View solution in original post

1 REPLY 1
suchomelb
Helper I
Helper I

Figures i'd figure it out shortly after posting. I just put an IF statement before the SWITCH to get rid of any rows where one of my columns is greater than 0, thus removing everything where dates dont have data or any dates in between my date range that were empty, which it was grabbing as well.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.

Top Solution Authors