The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Please help me troubleshoot this DAX Code. I am trying to build a cashflow statement with slicers for period and date, such that when a date is selected, the period starts from that date. For example, if June 2023 is chosen in the date slicer and T3 in the period slicer, I get data for April, May, and June 2023. I have written this DAX code for the period slicer and the date slicer uses a date table. I am getting this error on using selectedvalue.
When I use max('Cash Flow'[DateFormatted]), there is no error but period does not shift based on the date selected i.e. if June 2023 and T3 are selected on slicers, there will be a blank because max('Cash Flow'[DateFormatted]) is May 2024 and T3 from that don't have June 2023 in it. If I select all on date and then select T3, I get March-May 2024 data
A circular dependency was detected: Date_filter_CF[Date_filter_CF], 1211b2b7-f4c3-36fa-76d1-071fa6217ab1, Date_filter_CF[Date], Date_filter_CF[Date_filter_CF].
Date_filter_CF =
VAR _current= SELECTEDVALUE('Date Table'[Date])
VAR _Inception= min('Cash Flow'[DateFormatted])
RETURN
UNION(
ADDCOLUMNS(
CALENDAR(EOMONTH(_current,-11), _current)
,"filter", "T12"
,"Order",0),
ADDCOLUMNS(
CALENDAR(EOMONTH(_current,-5), _current)
,"filter", "T6"
,"Order",1),
ADDCOLUMNS(
CALENDAR(EOMONTH(_current,-2), _current)
,"filter", "T3"
,"Order",2),
ADDCOLUMNS(
CALENDAR(EOMONTH(_current,-23), EOMONTH(_current,-12))
,"filter", "Previous T12"
,"Order",3),
ADDCOLUMNS(
CALENDAR(_Inception,_current)
,"filter", "Inception to Date"
,"Order",3)
)
You cannot/should not create calculated tables from filter choices. Instead, create a static reference table with your periods.
Or - teach your users how to use the relative date filters on the filter pane.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
77 | |
73 | |
47 | |
39 |
User | Count |
---|---|
137 | |
108 | |
69 | |
64 | |
56 |