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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
T-Pan
Helper I
Helper I

Variable Start and End Time per Country

Hello Everyone, 

I have crated a column using variables, but i have a problem set specific Start Time and End Time depending each Country. 

Business Elapsed Hours (Created to Screening) = VAR BusHoursStart = TIME(09,45,00)
VAR BusHoursEnd = TIME(18,15,00).

I want BusHoursStart to be (09,45,00) if the values of column Country are (Greece or France), and BusHoursStart (11,45,00) if values are (UK or USA). 

 

 

1 REPLY 1
sdg1393
Frequent Visitor

Not sure if I understood your problem statement correctly on how dynamic you want this to be , but as a generic - 

1. Create two custom columns 1 for start time and 1 for end time

2. sample dax for start -

Business Hours Start =

var _bushourstart1 = Time(09,45,00)

var _bushourstart2 = Time(11,45,00)

 

Retrun 

switch(

True(),

table[country] == "USA", _bushourstart2,

table[country] == "UK", _bushourstart2,

table[country] == "France", _bushourstart1,

table[country] == "Greece", _bushourstart2

)

 

3. do the same step for endtime

 

if you want dymamic then need to put these country and start and endtime in a master table or file then join with data table and need to change the dax field accordingly 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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