Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Table/Output needed:
There is a single column for Category in the dataset. Similarly, there is a single column for Month. The need is to use two slicers (one for base month and the other comparison) to get two columns and then Trend=(Base Month Data-Comparison Month Data). Data for both months is coming from a single 'Value' column in the dataset.
Solved! Go to Solution.
Hi @bizbi,
Suppose the data table is called 'Table1'. First, you need two extra tables that are unrelated to 'Table1', to provide the list of Months.
Table for slicer1 = VALUES(Table1[Month]) Table for slicer2 = VALUES(Table1[Month])
Then, create below measures. Now that you want two slicers, you should drag month columns from two separate tables ('Table for slicer1' and 'Table for slicer2') into two slicers.
Slicer1 selection = LASTNONBLANK('Table for slicer1'[Month],1) Slicer2 selection = LASTNONBLANK('Table for slicer2'[Month],1) Base Month data = CALCULATE(SUM(Table1[Value]),FILTER(Table1,Table1[Month]=[Slicer1 selection])) Comparison Month data = CALCULATE(SUM(Table1[Value]),FILTER(Table1,Table1[Month]=[Slicer2 selection])) Trend = [Base Month data]-[Comparison Month data]
Best regards,
Yuliana Gu
Hi @bizbi,
Suppose the data table is called 'Table1'. First, you need two extra tables that are unrelated to 'Table1', to provide the list of Months.
Table for slicer1 = VALUES(Table1[Month]) Table for slicer2 = VALUES(Table1[Month])
Then, create below measures. Now that you want two slicers, you should drag month columns from two separate tables ('Table for slicer1' and 'Table for slicer2') into two slicers.
Slicer1 selection = LASTNONBLANK('Table for slicer1'[Month],1) Slicer2 selection = LASTNONBLANK('Table for slicer2'[Month],1) Base Month data = CALCULATE(SUM(Table1[Value]),FILTER(Table1,Table1[Month]=[Slicer1 selection])) Comparison Month data = CALCULATE(SUM(Table1[Value]),FILTER(Table1,Table1[Month]=[Slicer2 selection])) Trend = [Base Month data]-[Comparison Month data]
Best regards,
Yuliana Gu
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |