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
I have 1 Fact table and 1 Date table. I would like 2 new metrics.
Earliest week of =
Latest week of =
Both metrics should be based on the orders in the Fact table, not the Date table. I'm still learning.
Thanks
Solved! Go to Solution.
Try these measures:
Earliest Week Of =
VAR vMinFactDate =
CALCULATE ( MIN ( 'FACT'[DATE] ), ALL ( 'FACT' ) )
VAR vTable =
FILTER ( ALL ( 'DATE' ), 'DATE'[DATE] = vMinFactDate )
VAR vResult =
MAXX ( vTable, 'DATE'[WEEK OF] )
RETURN
vResultLatest Week Of =
VAR vMaxFactDate =
CALCULATE ( MAX ( 'FACT'[DATE] ), ALL ( 'FACT' ) )
VAR vTable =
FILTER ( ALL ( 'DATE' ), 'DATE'[DATE] = vMaxFactDate )
VAR vResult =
MAXX ( vTable, 'DATE'[WEEK OF] )
RETURN
vResult
Proud to be a Super User!
Try these measures:
Earliest Week Of =
VAR vMinFactDate =
CALCULATE ( MIN ( 'FACT'[DATE] ), ALL ( 'FACT' ) )
VAR vTable =
FILTER ( ALL ( 'DATE' ), 'DATE'[DATE] = vMinFactDate )
VAR vResult =
MAXX ( vTable, 'DATE'[WEEK OF] )
RETURN
vResultLatest Week Of =
VAR vMaxFactDate =
CALCULATE ( MAX ( 'FACT'[DATE] ), ALL ( 'FACT' ) )
VAR vTable =
FILTER ( ALL ( 'DATE' ), 'DATE'[DATE] = vMaxFactDate )
VAR vResult =
MAXX ( vTable, 'DATE'[WEEK OF] )
RETURN
vResult
Proud to be a Super User!
If 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.
| User | Count |
|---|---|
| 45 | |
| 43 | |
| 39 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 65 | |
| 31 | |
| 28 | |
| 24 |