Forum Discussion
To select week, mtd, quarter based on parameter
I have created a parameter week, mtd,qtd, quarter.
If week is selected that particular week's data should be shown.
For example if I have selected week the records of this week should be shown in table.
I have created calculated field for all the values in parameter.
If week is selected onl this weeks value should be shown.
I have attached the pbi file:
How to do this in power Bi
Help in this is needed.
Thanks in advance
Display slicer is not connected in any way to the table visual. A measure is needed so that the value changes in the visual.
Reference this DAX:
Switch ( selectedvalue(Dates[Display]) ,"Week", calculate(sum(Table[Salary]), filter(Table, 'Table'[Week]= TRUE())),"mtd", calculate(sum(Table[Salary]), filter(Table, 'Table'[Mtd]= TRUE())),"quarter", calculate(sum(Table[Salary]), filter(Table, 'Table'[Quarter]= TRUE())),"qtd", calculate(sum(Table[Salary]), filter(Table, 'Table'[Qtd]= TRUE())))Make changes according to tables and convenience.
2 Replies
- ChiragGarg2512
Solution Sage
Display slicer is not connected in any way to the table visual. A measure is needed so that the value changes in the visual.
Reference this DAX:
Switch ( selectedvalue(Dates[Display]) ,"Week", calculate(sum(Table[Salary]), filter(Table, 'Table'[Week]= TRUE())),"mtd", calculate(sum(Table[Salary]), filter(Table, 'Table'[Mtd]= TRUE())),"quarter", calculate(sum(Table[Salary]), filter(Table, 'Table'[Quarter]= TRUE())),"qtd", calculate(sum(Table[Salary]), filter(Table, 'Table'[Qtd]= TRUE())))Make changes according to tables and convenience.- asdf1608
Helper V
ChiragGarg2512 Thank you so much for your help.
It worked.