Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi Everyone,
We have a matrix table where we are showing data for 8 financial years (FY22 to FY30) in total.
We have to implement the following condition for the financial years
For prior years (FY22,23,24), we need to show actuals.
For current year (FY25), we need to toggle between Budget and different forecast.
For next year (FY26), we need to toggle between 5 year forecast and budget.
For years later (FY27,28,29,30), we need to show 5 year forecast.
We are calculating $ value using measures and the measure are created using a filter based on a data type filte. We are trying to use Selectedvalue function from Pwoer BI to capture the Data type from the user and calculate the measures dynamically for current year.. However, Selectedvalue is not working and returning blank data. So we get only a blank column for current year.
Data Type table contains values like Actuals, Budget, Forecast V1, Forecast V2.
Can someone please help us to resolve this to fetch the data for current year using the value selected by the user from the Data Type slicer?
Regards
Solved! Go to Solution.
To dynamically show different data types (Actuals, Budget, Forecast) based on the financial year and a slicer selection using SELECTEDVALUE(), ensure the setup is correct and follows this structured approach:
DAX Selected Data Type = SELECTEDVALUE('Data Type'[Type])If this returns blank, make sure:
DAX Selected Data Type = SELECTEDVALUE('Data Type'[Type], "Budget")
DAX Dynamic Value = VAR SelectedType = SELECTEDVALUE('Data Type'[Type], "Budget") VAR CurrentYear = "FY25" VAR NextYear = "FY26" VAR FY = SELECTEDVALUE('Date'[FinancialYear]) RETURN SWITCH(TRUE(), FY IN {"FY22", "FY23", "FY24"}, [Actuals Measure], FY = CurrentYear && SelectedType = "Budget", [Budget Measure], FY = CurrentYear && SelectedType = "Forecast V1", [Forecast V1 Measure], FY = CurrentYear && SelectedType = "Forecast V2", [Forecast V2 Measure], FY = NextYear && SelectedType = "Budget", [Budget Measure], FY = NextYear && SelectedType = "5 Year Forecast", [5 Year Forecast Measure], FY IN {"FY27", "FY28", "FY29", "FY30"}, [5 Year Forecast Measure], BLANK() )Replace each `[Measure]` placeholder with the actual measure for that data type.
✔️ If my message helped solve your issue, please mark it as Resolved! 👍 If it was helpful, consider giving it a Kudos! |
Hi @sanjyot_firke
Thanks for reaching out to Fabric Community.
Yes you’re correct maintaining separate measures for every data type (Budget, Actuals, multiple Forecasts, etc.) can become difficult to manage, especially as the number of types grows or changes. Fortunately, there’s a scalable pattern you can use a single measure with LOOKUPVALUE or CALCULATE—that works dynamically with your slicer.
To simplify maintenance, you can use a single dynamic measure that responds to both year and data type slicer selections, without creating separate measures for each data type.
**********************************************************************
Dynamic Value =
VAR SelectedType = SELECTEDVALUE('Data Type'[Type], "Budget")
VAR FY = SELECTEDVALUE('Date'[FinancialYear])
RETURN
SWITCH(
TRUE(),
FY IN {"FY22", "FY23", "FY24"}, CALCULATE(SUM('FactTable'[Value]), 'FactTable'[DataType] = "Actuals"),
FY IN {"FY25", "FY26"}, CALCULATE(SUM('FactTable'[Value]), 'FactTable'[DataType] = SelectedType),
FY IN {"FY27", "FY28", "FY29", "FY30"}, CALCULATE(SUM('FactTable'[Value]), 'FactTable'[DataType] = "5 Year Forecast"),
BLANK()
)
**********************************************************************
Ensure your fact table is in a long format (one column for Value, one for Data Type, etc.).
The Data Type slicer should be based on a disconnected table.
This pattern allows you to add or remove data types without changing your measure logic.
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.
We haven't heard from you since last response and just wanted to check whether the solution provided has worked for you. If yes, please Accept as Solution to help others benefit in the community.
Thank you.
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.
It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered?
If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!
Best Regards,
Community Support Team _ C Srikanth.
I wanted to follow up since I haven't heard from you in a while. Have you had a chance to try the suggested solutions?
If your issue is resolved, please consider marking the post as solved. However, if you're still facing challenges, feel free to share the details, and we'll be happy to assist you further.
Looking forward to your response!
Best Regards,
Community Support Team _ C Srikanth.
Hi @sanjyot_firke
Thanks for reaching out to Fabric Community.
Yes you’re correct maintaining separate measures for every data type (Budget, Actuals, multiple Forecasts, etc.) can become difficult to manage, especially as the number of types grows or changes. Fortunately, there’s a scalable pattern you can use a single measure with LOOKUPVALUE or CALCULATE—that works dynamically with your slicer.
To simplify maintenance, you can use a single dynamic measure that responds to both year and data type slicer selections, without creating separate measures for each data type.
**********************************************************************
Dynamic Value =
VAR SelectedType = SELECTEDVALUE('Data Type'[Type], "Budget")
VAR FY = SELECTEDVALUE('Date'[FinancialYear])
RETURN
SWITCH(
TRUE(),
FY IN {"FY22", "FY23", "FY24"}, CALCULATE(SUM('FactTable'[Value]), 'FactTable'[DataType] = "Actuals"),
FY IN {"FY25", "FY26"}, CALCULATE(SUM('FactTable'[Value]), 'FactTable'[DataType] = SelectedType),
FY IN {"FY27", "FY28", "FY29", "FY30"}, CALCULATE(SUM('FactTable'[Value]), 'FactTable'[DataType] = "5 Year Forecast"),
BLANK()
)
**********************************************************************
Ensure your fact table is in a long format (one column for Value, one for Data Type, etc.).
The Data Type slicer should be based on a disconnected table.
This pattern allows you to add or remove data types without changing your measure logic.
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.
Thank you so much for the responses team.
I am going to try both the above suggested solutions and let everyone know which one worked for us.
To dynamically show different data types (Actuals, Budget, Forecast) based on the financial year and a slicer selection using SELECTEDVALUE(), ensure the setup is correct and follows this structured approach:
DAX Selected Data Type = SELECTEDVALUE('Data Type'[Type])If this returns blank, make sure:
DAX Selected Data Type = SELECTEDVALUE('Data Type'[Type], "Budget")
DAX Dynamic Value = VAR SelectedType = SELECTEDVALUE('Data Type'[Type], "Budget") VAR CurrentYear = "FY25" VAR NextYear = "FY26" VAR FY = SELECTEDVALUE('Date'[FinancialYear]) RETURN SWITCH(TRUE(), FY IN {"FY22", "FY23", "FY24"}, [Actuals Measure], FY = CurrentYear && SelectedType = "Budget", [Budget Measure], FY = CurrentYear && SelectedType = "Forecast V1", [Forecast V1 Measure], FY = CurrentYear && SelectedType = "Forecast V2", [Forecast V2 Measure], FY = NextYear && SelectedType = "Budget", [Budget Measure], FY = NextYear && SelectedType = "5 Year Forecast", [5 Year Forecast Measure], FY IN {"FY27", "FY28", "FY29", "FY30"}, [5 Year Forecast Measure], BLANK() )Replace each `[Measure]` placeholder with the actual measure for that data type.
✔️ If my message helped solve your issue, please mark it as Resolved! 👍 If it was helpful, consider giving it a Kudos! |
Thank you @SolomonovAnton for the detailed answer.
We are not keen on creating individual measure variables for each data types as we have lot of intermdiate budget versions that we need to create measures for. This will create an issue in terms of maintenance or when a new data type is added or deleted from the table.
Is there a way where we can reuse 1 single measure to toggle between multiple data types?
Regards,
Sanjyot
Hi @sanjyot_firkeIt might be that the slicer allows multiple selections, causing SELECTEDVALUE to return blank. Ensure the slicer is set to Single Select and add a default value in the measure to handle blank cases. Use SWITCH logic to handle the conditions dynamically for each financial year based on the slicer input.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
57 | |
28 | |
25 | |
22 | |
21 |
User | Count |
---|---|
63 | |
47 | |
24 | |
24 | |
18 |