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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Flo95
Frequent Visitor

IF Function

Hello everyone,

 

i need a Measure for the following Example:

- The "Dunning Level" Column needs to be filled with the measure

- If "Dunning Level 1" >= Todays Date         --> "Dunning Level" should be filled with "Level 1"

- If "Dunning Level 2" >= Todays Date         --> "Dunning Level" should be filled with "Level 2"

- If "Dunning Level 3" >= Todays Date         --> "Dunning Level" should be filled with "Level 3"

- If "Dunning Level 4" >= Todays Date         --> "Dunning Level" should be filled with "Level 4"

Flo95_0-1705493851225.png

 

I already created it in Excel, but I dont know how to do it with a measure in Power Bi (its german language):

Flo95_1-1705494034778.png

 

Many thanks for your help!

 

Kind regards,

Florian

1 ACCEPTED SOLUTION
Flo95
Frequent Visitor

I solved the problem with the following code:

Dunning Level =
SWITCH(
        TRUE(),
        TODAY() >= [Dunning Level 4], "Level 4",
        TODAY() >= [Dunning Level 3], "Level 3",
        TODAY() >= [Dunning Level 2], "Level 2",
        TODAY() >= [Dunning Level 1], "Level 1",
        "N/A"
    )

View solution in original post

5 REPLIES 5
Flo95
Frequent Visitor

I solved the problem with the following code:

Dunning Level =
SWITCH(
        TRUE(),
        TODAY() >= [Dunning Level 4], "Level 4",
        TODAY() >= [Dunning Level 3], "Level 3",
        TODAY() >= [Dunning Level 2], "Level 2",
        TODAY() >= [Dunning Level 1], "Level 1",
        "N/A"
    )
az38
Community Champion
Community Champion

Hi @Flo95 

I would suggest you need a calculated column, but not a measure

 SWITCH(
		TRUE(),
		[Dunning Level 1] >= TODAY(), "Level 1",
		[Dunning Level 2] >= TODAY(), "Level 2",
		[Dunning Level 3] >= TODAY(), "Level 3",
		[Dunning Level 4] >= TODAY(), "Level 4",
		"N/A"
	)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Flo95
Frequent Visitor

Hi @az38 

 

The columns "Dunning Level 1/2/3/4" were also created by an Measure.

Is it still possible to do a calculated column then?

Im pretty new working with Power BI

 

Many thanks for your response!

 

Kind regards,

Florian

 

az38
Community Champion
Community Champion

@Flo95 

Yes, measures within measures should also work


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Flo95
Frequent Visitor

Hello @az38 

 

I tried it this way now:

Flo95_0-1705558336427.png

But as you can see they all should be in Dunning Level 4, because Today we have 2024 and all of this orders are from 2023. 

 

So it doesnt switch from Dunning Level 1 to Dunning Level 2, Level 3 and Level 4. Do you understand?

 

Many many thanks again for your help! 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.