Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi Team,
Is there a way to show only One week Data By default without any filter on a table visual and based on the week selection change accordingly ? May be a DAX that just filter on the current week ? I am new to power BI and need this functionality . Thanks in advance . Currently that table has 12 weeks of data by default .
Solved! Go to Solution.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @DharmaChinta,
If you still want the slicers to work on it, you can try the measure below.
Measure =
VAR selectedWeek =
SELECTEDVALUE ( 'calendar'[week] )
RETURN
IF (
ISBLANK ( selectedWeek ),
CALCULATE (
SUM ( 'table'[value] ),
FILTER ( calendar, WEEKNUM ( 'calendar'[date], 2 ) = WEEKNUM ( TODAY (), 2 ) )
),
CALCULATE (
SUM ( 'table'[value] ),
FILTER ( calendar, WEEKNUM ( 'calendar'[date], 2 ) = selectedWeek )
)
)
Best Regards,
Dale
Hi @DharmaChinta,
If you still want the slicers to work on it, you can try the measure below.
Measure =
VAR selectedWeek =
SELECTEDVALUE ( 'calendar'[week] )
RETURN
IF (
ISBLANK ( selectedWeek ),
CALCULATE (
SUM ( 'table'[value] ),
FILTER ( calendar, WEEKNUM ( 'calendar'[date], 2 ) = WEEKNUM ( TODAY (), 2 ) )
),
CALCULATE (
SUM ( 'table'[value] ),
FILTER ( calendar, WEEKNUM ( 'calendar'[date], 2 ) = selectedWeek )
)
)
Best Regards,
Dale
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsTo add also the current year:
Measure = CALCULATE ( SUM ( Table[Column] ); FILTER ( ALL ( Table[DateColumn] ); WEEKNUM ( Table[DateColumn] ) = WEEKNUM ( TODAY () ) && YEAR ( Table[DateColumn] ) = YEAR ( TODAY () ) ) )
Thanks a lot!
Sorry I deleted your answer by accident
Is it possible have sales till yesterday instead till today?
Hi,
Subtract 1 from TODAY() i.e. TODAY()-1
Is this also possible for the current week and the current year? I have multiple years.
Hi @Anonymous
You need to add the year to the filter part of the measure:
Measure =
CALCULATE (
SUM ( Table[Column] );
FILTER (
ALL ( Table[DateColumn] );
WEEKNUM ( Table[DateColumn] ) = WEEKNUM ( TODAY () )
&&
YEAR ( Table[DateColumn] ) = YEAR ( TODAY () )
)
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsIf you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 25 |