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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Minyun
Frequent Visitor

Using TREATAS to dynamic budget granularity

Hi,

 

I am new to PowerBI and after reading through several articles I am still trying to wrap my head around the TREATAS function.

 

I have created a BudgetTable as below, listing budget values ('Value') per YearMonth (for the 2021 period) for various business branches ('Depot') and associated business types ('BusType'). I have also summed these values with a measure ('TotalValue')

Minyun_1-1634718442719.png

 

I have created a DateTable with the columns listed below **Note that this DateTable ranges from 2020-01-01 to 2021-21-31 (again BudgetTable only lists budget values for the 2021 period).

Minyun_2-1634718533058.png

 

I have created a measure (BudSplit) within my fact table (spRptPBIUnpackBudget-which is imported from MS SQL) as per the below. This works no problem, showing me budgets per MonthName as expected.

Minyun_3-1634718732111.png

 

...however the problem is that when I drill down to the relevant sub-dimensions (WeekNumber and DayNumber) the measure does not perform as expected as per the below...

Minyun_4-1634719265831.png

...the BudSplit measure is still showing values for MonthName rather than WeekNumber and/or DayNumber.

 

Finally my table relationships are as per the below.

Minyun_5-1634719823818.png

 

I suspect that this has something to do with my TREATAS DAX but am unsure how it should be modified to accommodate the sub-dimensions.

 

Any advice or help would be greatly appreciated.

 

Thank you.

 

3 REPLIES 3
v-cazheng-msft
Community Support
Community Support

Hi @Minyun 

 

Your description is quite clear and I've got what your problem is. Could you please tell me how you create relationships between Date table and table from MS SQL? If convenient, could you please provide a link of upload sample pbix file so we can do research on it to help you find the solution? Thanks in advance!

 

Best Regards,

Community Support Team _Caiyun Zheng

Hi,

 

Thank you for responding. I am unable to share the .pbix.

 

The relationship between DateTable and MS SQL is using an additional column called DateJoin

 

DateJoin =

FORMAT(DateTable[Date], "YYYY")

&"-"&FORMAT(DateTable[Date], "MM")

&"-"&FORMAT(WEEKNUM(DateTable[Date],2),"00")

&"-"&FORMAT(DateTable[Date],"DD"))

 

This allows me to create 1 -> * relationship through all of my fact tables.

@Minyun 

 

Sorry for the late response. I’ve tested at my side based on the information from you, but I can drill down with this Measure. Not sure whether there is any other factor caused this issue.

vcazhengmsft_0-1635496662020.png

 

 

vcazhengmsft_1-1635496662024.png

 

 

Attached sample pbix file, it may help you find the cause.

 

Best Regards,

Community Support Team _ Caiyun

 

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

 

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.