Forum Discussion
Yield curve in PowerBI
- Anonymous3 years ago
Hi AndreeaV ,
If you want to create line charts as the app in the link, I think you need to transform your underlying data by UNPIVOT function.
Select [Date] column and use UNPIVOT other columns. New table should look like as below.
Measure:
Most Recent = VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table')) RETURN CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date)Week Ago = VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table')) return CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date - 7)Month Ago = VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table')) return CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date - DAY(EOMONTH(_Recent_Date,-1)))...
Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi AndreeaV ,
If you want to create line charts as the app in the link, I think you need to transform your underlying data by UNPIVOT function.
Select [Date] column and use UNPIVOT other columns. New table should look like as below.
Measure:
Most Recent =
VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table'))
RETURN
CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date)Week Ago =
VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table'))
return
CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date - 7)Month Ago =
VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table'))
return
CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date - DAY(EOMONTH(_Recent_Date,-1)))
...
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.