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.
Hello Experts,
I have a date field. I want to display data dynamically so that whenever User selects particular date, data should be filtered accordingly.
I created a Date parameter (transform data-> New Parameter) with some Values and joined (Many to One) with the actual table.
Now I am trying to create a calculation
Flag Current Month=YEAR(Table[Date]) = YEAR(Paramter table[Date])
Here I'm unable to select the Parmater Date as they are not populating.
Am i missing something or is there any other way to create the flags CM, PM, CY, PY etc.
Thanks in advance
@Kumar_0606 You need to create calculated fields to flag the current month, previous month, current year, and previous year based on the selected date parameter.
FlagCurrentMonth =
IF(
YEAR(Table[Date]) = YEAR(SELECTEDVALUE(ParameterTable[Date])) &&
MONTH(Table[Date]) = MONTH(SELECTEDVALUE(ParameterTable[Date])),
1,
0
)
FlagPreviousMonth =
IF(
YEAR(Table[Date]) = YEAR(SELECTEDVALUE(ParameterTable[Date])) &&
MONTH(Table[Date]) = MONTH(SELECTEDVALUE(ParameterTable[Date])) - 1,
1,
0
)
FlagCurrentYear =
IF(
YEAR(Table[Date]) = YEAR(SELECTEDVALUE(ParameterTable[Date])),
1,
0
)
FlagPreviousYear =
IF(
YEAR(Table[Date]) = YEAR(SELECTEDVALUE(ParameterTable[Date])) - 1,
1,
0
)
Make sure that your parameter table is properly linked to your main table. The SELECTEDVALUE function is used to get the value of the parameter selected by the user.
Proud to be a Super User! |
|
Hello Gautam,
Thanks for the reply.
I created Current Month flag as you suggested and created a column like
Amount CM= IF ([Flag Current Month]=1 && Table[Version]="New", [Amount]))
When i pulled this to the table, getting Blank value.
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 |
---|---|
58 | |
55 | |
55 | |
37 | |
30 |
User | Count |
---|---|
78 | |
64 | |
45 | |
42 | |
40 |