Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello everyone,
I am trying to create filters based on a slicer.
I have a table of sales and I have created a separate table with conditions on the years.
The way I would like my report to work is:
If 'Show reliable YTD data' is selected, then I want to filter everything which belongs to this year and who's month is 2 months before today. Example: today the report would show all volumes for 2020 from Jan to March.
If 'Show all YTD data' is selected, then I want to filter everything which is not in 2020.
If 'Show all YTD data and Previous year' is selected, then I want to show everything from 2020 and 2019.
I would like to create a custom column in my Main table which would put 1 on each line that fulfills the above selected condition. Like this I can sum up the volume based only on the periods I want to consider.
Then the aim would be that I create a measure that sums volume for every line where Custom col = 1.
Like this I can capture the sales corresponding to the periods I want filtered.
If you have a better approach do not hesitate to show me and thanks for the help!
@amitchandak Thank you for the answer.
I basically want to filter my data based on criterias from a slicer.
But tbh creating new measures for every data is very inefficient... In Tableau a simple filter works...
Values in a calculated column are fixed. But you may use ADDCOLUMNS in a measure.
https://www.sqlbi.com/articles/naming-temporary-columns-in-dax/
@v-chuncz-msft Thank you for your answer, this indeed would be a bit better than creating so many new columns.
In the end, I bypassed the issue by using additional tables to filter the dates. Like this this I use one single volume column.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
126 | |
78 | |
78 | |
59 | |
51 |
User | Count |
---|---|
165 | |
83 | |
68 | |
68 | |
59 |