Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi to all,
I have "yearly campaign" values and a slicer with which I can select the yearly capmaign.
Then I have a measure that should bring the count of values of the previus year:
Solved! Go to Solution.
Hi, @gunicotra
You can modify the code like this to test where the problem is:
FA_PY =
calculate(COUNT(Table[ID]),
ALL(Table[Year]),
Table[Year]=SELECTEDVALUE(Table[Year]))
I can't find the problem from your description. So I sugget you share some sample data with us to check.
If the problem still exists, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
There is no need to use ALL() when you then specify a replacement filter value. Your scenario should work as you describe. Maybe you can provide some sample data to illustrate the issue.
Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI
sure.
I have this year slicer filter:
and a measure:
According to this data, I would expect that, though I have indicated 2020 in the filter slicer, the measure would give me the 2019 data. The result is, instead:
- "blank" if you consider the measure as it is represented;
- "all the correct data related to the 2020 campaignn year", if you replace the "YearPrec" var with 2020..
As far as I can see the ALL() does not work properly.
I have also removed the ALL() statement leaving just the "Table[Year]=YearPrec", as you suggested, but the result has been the same.
Hi, @gunicotra
You can modify the code like this to test where the problem is:
FA_PY =
calculate(COUNT(Table[ID]),
ALL(Table[Year]),
Table[Year]=SELECTEDVALUE(Table[Year]))
I can't find the problem from your description. So I sugget you share some sample data with us to check.
If the problem still exists, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
I have followed your suggestion and I found that my slicer was erroeously applied to a Table1[Year], while the measure was defined on a different table Table[Year]!
Though the two table were connected through this same columns, the desired result did not happend.
Thanks for you hint 😉
Hi, @gunicotra
So, After you modify, is everything normal?
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If you still need help, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
yes thanks!
Hi,
You should have a Calendar Table with Year as a calculated column in the Calendar Table. To your slicer, drag Year from the Calendar Table. Write this measure
Hi Ashish_Mathur,
thanks for your suggegstion. Unfortunately I can not use time intelligent functions becouse the yearly campaign data are not to be fond in the same yearly period of the previus yesr (as an example: I can have 2020 campaing data from november 19 to septemper 20 and the 2021 capmaing data from november 20 to december 22). Using time intelligent function, I may loose some data
Maybe you can provide some sample data to illustrate the issue.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
83 | |
82 | |
72 | |
49 |
User | Count |
---|---|
143 | |
130 | |
108 | |
64 | |
55 |