Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)

I am having a data which is showing area chart as weekly,monthly 

Data Format

I want to show the measure as daily,weekly,monthly How can I do that?

1 Answer

0 votes
by (22.5k points)

Use the following measure

Submitted Sum=

var Daily_Sum= CALCULATE(SUM(Table1[Submitted]),ALLEXCEPT(Table1, Table1[Position Type],Table1[Date]))

var Weekly_Sum=CALCULATE(SUM(Table1[Submitted]),FILTER(ALLSELECTED(Table1), YEAR(Table1[Date]) =YEAR(MAX(Table1[Date]))&&WEEKNUM(Table1[Date]) =WEEKNUM(MAX(Table1[Date]))))

Var Monthly_Sum= CALCULATE(SUM(Table1[Submitted]),FILTER(ALLSELECTED(Table1), YEAR(Table1[Date]) =YEAR(MAX(Table1[Date]))&&MONTH(Table1[Date]) =MONTH(MAX(Table1[Date]))))

return

IF(ISFILTERED('Slicer Table'[Selection]),
    SWITCH(SELECTEDVALUE('Slicer Table'[Selection]),
        "Daily", Daily_Sum,
        "Weekly", Weekly_Sum,
        "Monthly", Monthly_Sum
    ),
   BLANK()
)

Want to learn more about Power BI? Check out today: Power BI course    

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...