Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi
My daily target turnover is $270000. I have a slicer for the year. The data is from 01/01/2023. I want when only the year 2023 is slected in the slicer the maximum value should come as 365 * 270000 if only 2024 is selected from the slicer then the maximum value should come 365 * 270000 if both the years are selected then 730 * 270000 and so on. If in case nothing is selected in the slicer then it should calculate (Today() - date(2023,1,1)) * 270000
Can somebody please help me to achieve this
Solved! Go to Solution.
Hi @euro_sree ,
To achieve your requirement, you can create a DAX measure that dynamically calculates the maximum value based on the selected year(s) in the slicer. Here’s how to do it:
Assume You Have a Date Table:
Create the Measure:
Maximum Target Turnover =
VAR SelectedYears = VALUES(DateTable[Year]) -- Get the selected years
VAR TotalDays =
IF(
ISFILTERED(DateTable[Year]),
SUMX(SelectedYears, 365), -- Calculate total days for selected years
TODAY() - DATE(2023, 1, 1) -- Days from 01/01/2023 to today
)
RETURN
TotalDays * 270000Explanation:
Add the Measure to Your Visual:
Test the Functionality:
This measure is dynamic and should meet your requirement for handling both slicer selections and the default case when nothing is selected. Let me know if you need further adjustments! 😊
Please mark this as solution if it helps. Appreciate Kudos.
Hi @euro_sree ,
The method FarhanJeelani provided should be helpful.
Besides, you can also try the following DAX formula to calculate the max value based on slicer.
Maximum Target Turnover =
VAR SelectedYears = VALUES('Table'[Year])
VAR StartDate = DATE(2023, 1, 1)
VAR TodayDate = TODAY()
RETURN
IF (
ISFILTERED('Table'[Year]),
CALCULATE(COUNTROWS('Table') * 270000),
DATEDIFF(StartDate, TodayDate, DAY) * 270000
)
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @euro_sree ,
The method FarhanJeelani provided should be helpful.
Besides, you can also try the following DAX formula to calculate the max value based on slicer.
Maximum Target Turnover =
VAR SelectedYears = VALUES('Table'[Year])
VAR StartDate = DATE(2023, 1, 1)
VAR TodayDate = TODAY()
RETURN
IF (
ISFILTERED('Table'[Year]),
CALCULATE(COUNTROWS('Table') * 270000),
DATEDIFF(StartDate, TodayDate, DAY) * 270000
)
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @euro_sree ,
To achieve your requirement, you can create a DAX measure that dynamically calculates the maximum value based on the selected year(s) in the slicer. Here’s how to do it:
Assume You Have a Date Table:
Create the Measure:
Maximum Target Turnover =
VAR SelectedYears = VALUES(DateTable[Year]) -- Get the selected years
VAR TotalDays =
IF(
ISFILTERED(DateTable[Year]),
SUMX(SelectedYears, 365), -- Calculate total days for selected years
TODAY() - DATE(2023, 1, 1) -- Days from 01/01/2023 to today
)
RETURN
TotalDays * 270000Explanation:
Add the Measure to Your Visual:
Test the Functionality:
This measure is dynamic and should meet your requirement for handling both slicer selections and the default case when nothing is selected. Let me know if you need further adjustments! 😊
Please mark this as solution if it helps. Appreciate Kudos.
Hi Farhan
Thank you so much for the solution and appreciate the way its been explained.
I will try this today and update you.
Regards
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |