Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi
I am trying to get a table with Min and Max Years upon selecting two or more years from a date(Year) slicer.
I need help to get it working.
https://drive.google.com/file/d/1Haf8FMIICZOAiE839trkJgdJN1ZFLKrx/view?usp=sharing
I have this Table measure:
Thank you
Tamir
Solved! Go to Solution.
Hi @tamiribas
You can add a year column to the new table that you created :
Create a flag measure
Result :
PBIX is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
@tamiribas
Please check the attached file, I created a measure and assigned at the visual filter on the Filter pane. I think you do not have to create a separate table here. Please check
Min or Max =
VAR __MinYear =
CALCULATE(
MIN(dimDate[Year]),
ALLSELECTED( dimDate[Year] )
)
VAR __MaxYear =
CALCULATE(
MAX(dimDate[Year]),
ALLSELECTED( dimDate[Year] )
)
VAR __Result =
INT ( SELECTEDVALUE( dimDate[Year] ) in {__MinYear,__MaxYear} )
RETURN
__Result
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Actually, the following file expresses better the requirement.
https://drive.google.com/file/d/1sBYqwxXJrXE6fXhngeL_fglpzXFEJ8zP/view?usp=sharing
I didn't manage to force MIN Year and MAX year in the VARs.
I am using these values to show in the Calculated table.
Thank you,
Tamir
@tamiribas
Please check the attached file, I created a measure and assigned at the visual filter on the Filter pane. I think you do not have to create a separate table here. Please check
Min or Max =
VAR __MinYear =
CALCULATE(
MIN(dimDate[Year]),
ALLSELECTED( dimDate[Year] )
)
VAR __MaxYear =
CALCULATE(
MAX(dimDate[Year]),
ALLSELECTED( dimDate[Year] )
)
VAR __Result =
INT ( SELECTEDVALUE( dimDate[Year] ) in {__MinYear,__MaxYear} )
RETURN
__Result
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi
It's very interesting! I would be happy to see the answer, I also met with a similar task
Hi @tamiribas
You can add a year column to the new table that you created :
Create a flag measure
Result :
PBIX is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
User | Count |
---|---|
84 | |
79 | |
71 | |
48 | |
43 |
User | Count |
---|---|
111 | |
54 | |
50 | |
40 | |
40 |