Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Dear all,
can you please advise with the following?
I need to create report with custom "reporting years".
That means to select start and end date from the slicer - eg. Feb16-Jan18. First Year will be then Feb16-Jan17, Second Year Feb17-Jan18.
I managed to do this based on the calculated column:
MonthNum =
VAR StartMonth = 2
RETURN
IF (
MONTH ('DimDate'[DateVal] ) >= StartMonth,
MONTH ('DimDate'[DateVal] ) - (StartMonth - 1),
12
+ (
MONTH ('DimDate'[DateVal]) - (StartMonth - 1)))
In the code above I am putting "2" as a number of the month (february) and then recalculating the months order in the date table. Can you please advise how to assign the value dynamically from the slicer? If Im taking e.g.:
Hi @bon0
You can use a WhatIf parameter.
This provided a changeable value as a slicer which you can use to change the start month number.
Thanks,
George
Thanks George,
I tried your solution and it is not working. Can you please elaborate more on this topic?
Thanks
Jan
Hi @bon0
Instead of manually entering 2 for the variable you can assign the whatif parameter value instead.
When you change the whatif parameter using the slicer the variable changes and therefore the outcome changes accordingly.
Feel free to share your pbix file and i will assist where possible 🙂
Thanks,
George
Thanks, can you please advise how the share the pbix file? Can you provide your email?
All I need to do is to insert value from the slicer into the calculated column.
Thanks
Hi @bon0
You can try creating a shareable link through one drive or via the internet.
Alternatively if you are simply trying to add the parameter to the calculation, please attach a screenshot of the parameter table and columns and i will try to include the correct code in a reply 🙂
Thanks,
George
Parameter(StartMonth) = GENERATESERIES(1, 12, 1)
Apologies I missed that in your original question.
Yes a parameter will only affect a measure dynamically
Thanks,
George
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |