The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
30 |
User | Count |
---|---|
180 | |
88 | |
71 | |
48 | |
46 |