Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
I got stuck with the selected value DAX. Its returns blank like the below image. What am I missing.
Please help me. I know this looks silly but I don't understand the error.
TIA
Solved! Go to Solution.
Hi @Prabha45
The formula returns blank because you are using date hierarchy in your slicer.
So you didn't select a date, you selected the year and month.
Modify your measure according to the possible selections, for example :
PBIX is attached
If this post helps, then please consider Accepting it as the solution to help the other
members find it more quickly
Thanks @Ritaf1983
It worked, I'm trying to show value PLAN if month greater 2023 June based on the date hierarchy.
Measure =
Var selectyear = Selectedvalue(dim_date[date].[Year])
Var selectmonth = Selectedvalue(dim_date[date].[month])
Var ans = If(selectyear =2023 & selectmonth > "June",
[PLAN],
[ACTUAL])
The above measure throws an error. Doesn't support comparing values of type integer with values type text.
Please help on this
Hi @Prabha45
1. You can't use the operator "<>" to compare strings, and month in this case is a string.
2. if you nee and as an operator you should use "&&" and not "&"
modify your formula to :
The updated pbix is attached.
(i used just strings for plan and actual )
If this post helps, then please consider Accepting it as the solution to help the other
members find it more quickly
Thank you @Ritaf1983
Can we do it in reverse. Show data [Actual] if selected date less than 2023 June. Going forward data gets updated for 2024,2025....
My data starts from 2020.
Hi @Prabha45
I recommend just to work with a "Date" type slicer ...
working with hierarchies here seems to me too many "woodo dances" for the very simple scenario
If this post helps, then please consider Accepting it as the solution to help the other
members find it more quickly
Hi @Prabha45
The formula returns blank because you are using date hierarchy in your slicer.
So you didn't select a date, you selected the year and month.
Modify your measure according to the possible selections, for example :
PBIX is attached
If this post helps, then please consider Accepting it as the solution to help the other
members find it more quickly
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |