Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
"Today Sales= CALCULATE(COUNT(pbi_stock_sold[is_sold_from_stock]),FILTER(pbi_stock_sold,pbi_stock_sold[SoldDate]=TODAY()))"
"Yesterday Sales = CALCULATE(COUNT(pbi_stock_sold[is_sold_from_stock]),FILTER(pbi_stock_sold, pbi_stock_sold[SoldDate].[Date]=TODAY()-1))"
"This week Sales= CALCULATE(COUNT(pbi_stock_sold[is_sold_from_stock]),FILTER(pbi_stock_sold,YEAR(pbi_stock_sold[SoldDate])=YEAR(TODAY())&&WEEKNUM(pbi_stock_sold[SoldDate])=WEEKNUM(TODAY())))"
"This month Sales = CALCULATE(COUNT(pbi_stock_sold[is_sold_from_stock]),FILTER(pbi_stock_sold,YEAR(pbi_stock_sold[SoldDate])=YEAR(TODAY()) && MONTH(pbi_stock_sold[SoldDate])=MONTH(TODAY())))"
"This year Sales = CALCULATE(COUNT(pbi_stock_sold[is_sold_from_stock]),FILTER(pbi_stock_sold,YEAR(pbi_stock_sold[SoldDate])=YEAR(TODAY())))"
How can make above measure dynamic based on date selection in date slicer? They are static only show for recent date. Please guide....
Solved! Go to Solution.
Hi @shanu_123,
First, you need a calendar table which lists continual unique date values. Don't need to create a relationship between this calendar table and 'pbi_stock_sold'.
CalendarTable=CALENDAR(DATE(2017,1,1),DATE(2018,12,31))
Add [date] column from 'CalendarTable' to slicer.
Modify original measures to replace TODAY() with MAX('CalendarTable'[date]), for example:
Yesterday Sales = CALCULATE(COUNT(pbi_stock_sold[is_sold_from_stock]),FILTER(pbi_stock_sold, pbi_stock_sold[SoldDate].[Date]=MAX('CalendarTable'[date])-1))
Best regards,
Yuliana Gu
Hi @shanu_123,
First, you need a calendar table which lists continual unique date values. Don't need to create a relationship between this calendar table and 'pbi_stock_sold'.
CalendarTable=CALENDAR(DATE(2017,1,1),DATE(2018,12,31))
Add [date] column from 'CalendarTable' to slicer.
Modify original measures to replace TODAY() with MAX('CalendarTable'[date]), for example:
Yesterday Sales = CALCULATE(COUNT(pbi_stock_sold[is_sold_from_stock]),FILTER(pbi_stock_sold, pbi_stock_sold[SoldDate].[Date]=MAX('CalendarTable'[date])-1))
Best regards,
Yuliana Gu
Hi,
I'm using this method to filter the values in my measures and it works perfectly, but when the measure is referenced in a table the table does not display the change made to the measure by the filter.
The measure used for the date:
Dia Variable = MAX('Tabla Calendario'[Date])
The calculated measure using the method to change the date:
M_ECO_6m=
VAR DIA = [Dia Variable]
VAR MOTI = 0+CALCULATE(
COUNT('SB'[ANTIGUEDAD]),
'SB'[ANTIGUEDAD]IN { "+6M" },
NOT('SB'[GC] IN {"GC"}),
'SB'[date_op] = DIA,
'SB'[Description] IN {"MO_ECO"}
)
RETURN MOTI
The table im creating:
M_SB = {("M_Eco",[M_ECO_6m],[%_eco_6m],[M_ECO_X],[%_eco_x],[MO_ECO_G],[%_eco_g])}
when i put the measure in a KPI card it works fine but in the custom table it doesnt update with the filter.
Thanks in advance.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
117 | |
84 | |
49 | |
38 | |
28 |
User | Count |
---|---|
188 | |
76 | |
73 | |
54 | |
42 |