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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
filipe
New Member

Add new column with "where" clause

Hi all,

i'm newbie with DAX so your help would be really great.

I have two tables:

TableA: Energy Readings table (once a day I record total Energy consumption per energy counter). Columns: ReadingDate, CounterID, Energytable1.jpg

 

and than I have the Clients Table. Each client may have one or several counters associated (depends on room size...) and StartDate and EndDate. In this Table i'll keep record of old clients (to historize energy consumption), so the relation between this two tables is many-to-many:table2.jpg

 

...My problem here is that i need to keep track of the energy consumption by client.

My idea was to add a new Column to ReadingsTable with the actual client related to the reading date.

It would be something like this:table3.jpg

 

..any ideas on how to have the new column? The logic would be to add Client name with the related client from Client table according to the dates.

Thank you in advance!

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @filipe,

 

It seems the Date and the CounterID can determine a unique row. I would suggest you add such a column. No matter who is using that room, the history can be tracked. It could be like below.

 

ID =
FORMAT ( [ReadingDate], "YYYYMMDD" ) & [CounterID]

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @filipe,

 

It seems the Date and the CounterID can determine a unique row. I would suggest you add such a column. No matter who is using that room, the history can be tracked. It could be like below.

 

ID =
FORMAT ( [ReadingDate], "YYYYMMDD" ) & [CounterID]

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors