Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Solved! Go to Solution.
Hi @abigail11 ,
I tried to use a sample data myself based on your requirement and implemented the result. Please check if there is anything that can be improved. Here are the steps:
1.Load example data for demonstration:
2.Create a line chart visual and measure:
measure =
CALCULATE(SUM(financials[ Sales]),FILTER(ALLSELECTED(financials),'financials'[Month Number] <= MAX('financials'[Month Number])))
3.Creating a new table based on the month field avoids the need to perform filtering operations on line charts as well, by using the month in that table as a slicer field for other visuals.
4.When using other visuals, the following dax code can be written to create the measure, which will use the month of the new table:
Measure 2 =
CALCULATE(SUM(financials[COGS]),FILTER(ALLSELECTED(financials),'financials'[Month Number] = SELECTEDVALUE('Table'[Month Number])))
4. The final results obtained are as follows:
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @abigail11 ,
I tried to use a sample data myself based on your requirement and implemented the result. Please check if there is anything that can be improved. Here are the steps:
1.Load example data for demonstration:
2.Create a line chart visual and measure:
measure =
CALCULATE(SUM(financials[ Sales]),FILTER(ALLSELECTED(financials),'financials'[Month Number] <= MAX('financials'[Month Number])))
3.Creating a new table based on the month field avoids the need to perform filtering operations on line charts as well, by using the month in that table as a slicer field for other visuals.
4.When using other visuals, the following dax code can be written to create the measure, which will use the month of the new table:
Measure 2 =
CALCULATE(SUM(financials[COGS]),FILTER(ALLSELECTED(financials),'financials'[Month Number] = SELECTEDVALUE('Table'[Month Number])))
4. The final results obtained are as follows:
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
90 | |
77 | |
62 | |
47 | |
39 |
User | Count |
---|---|
118 | |
85 | |
80 | |
58 | |
40 |