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.
I have two measures:
I would like to create a third measure
3. Left working days
It's easy:
1 - 2 = 3
The measure created in this way works correctly at the level of detail of the day or month.
The challenge is how to display this measure on the card for the current day, while the data is filtered to the entire current month?
Example:
Current day: 2019-11-21
1. 19
2. 13
3. 6
Filtering the data range to the whole month, the card presents the value 0 instead of 6.
Solved! Go to Solution.
Hello @V-lianl-msft
Thank you for your support!
Unfortunately, the solution proposed does not work correctly for that problem.
I wrote another measure:
(related to my first post)
Measure =
VAR MaxDate = MAX(D_Dates[Date])
VAR CurrentDate = TODAY()
Return
IF(
[1] = [2];
CALCULATE(COUNTROWS(D_Dates);
D_Dates[Year] = YEAR(MaxDate);
D_Dates[Month] = MONTH(MaxDate);
D_Dates[Date] > CurrentDate;
D_Dates[IsWorkDay] = 1);
[3]
)
This is probably not the optimal solution, but it solves the problem 🙂
Hi @Anonymous ,
Measure 2 = CALCULATE(SUM(D_Dates[IsWorkDay]),FILTER(ALLSELECTED(D_Dates),D_Dates[IsWorkDay]=1))
If the result is not what you want,please provide the measure with DAX and try to provide sample data of the table.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @V-lianl-msft
Thank you for your support!
Unfortunately, the solution proposed does not work correctly for that problem.
I wrote another measure:
(related to my first post)
Measure =
VAR MaxDate = MAX(D_Dates[Date])
VAR CurrentDate = TODAY()
Return
IF(
[1] = [2];
CALCULATE(COUNTROWS(D_Dates);
D_Dates[Year] = YEAR(MaxDate);
D_Dates[Month] = MONTH(MaxDate);
D_Dates[Date] > CurrentDate;
D_Dates[IsWorkDay] = 1);
[3]
)
This is probably not the optimal solution, but it solves the problem 🙂
Hi @Anonymous ,
It's glad that you have solved your problem.
Please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |