Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
After days or trial and error I am finally giving up of being able to find a solution myself. I hope that one of you can help me.
Situation:
I have a general ledger entry table with a few million rows, and a few related tables like a Date table and a Category table.
PowerBI is great with standard date reporting, but the company I work for has specific needs making it impossible to use the standard. The user can select a few options that are set as parameters:
- Report Year: the year for which the report is being made;
- Report Quarter: the quarter until which the report is being made;
- CompareMethod: for instance for selected parameter Report Quarter = Q2 and Report Year = 2022, the user can choose to compare with previous year with 3 options:
1. Whole Year * Quarter Factor : data from 1/1/21 until 12/31/21 * 0,5,
2. Until_Report_Quarter : data from 1/1/21 until 6/30/21
3. Whole_Year : data from 1/1/21 until 12/31/21
The main matrix in the visual is a Main Category and Sub Category in the rows, and then Dax Measures for the columns:
- Report Year: this calculates the amount for the report year based on the selected year = Report Year and the selected calculation method, and other parameters;
- Report Year - 1: Same as before but with the year - 1.
- Report Year - 2: Same as before but with the year - 2.
- Forecast Report Year: forecast data for year = report year.
- Forecast Report Year + 1: forecast data for year = report year + 1.
- Some columns for % difference and amount differences.
It's great to have different columns for each, because that way I can set the column for current year green, previous year -1 dark red and previous year -2 light red, and budget/forecast as blue. This color scheme I use all over the graphs and tables. PowerBi would allow me to set 2022 to green, but I want that only to be green if the Report Year = 2022. If report year = 2023 then 2022 needs to be dark red.
For the DAX formula for "Report Year - 1" I have the following:
Time intelligence is not possible for giving the user the options I described and color code the matrix.
I think the main problem is that PowerBi says the query goes over 1.000.000 rows. If that wasn't the case I could filter on the measure <>0 and then other years would be filtered out with that. There must be something very inefficient or wrong in my dax formula. The created matrix goes down to row level in the ledger entry. The measure only needs to calculate for the rows shown which is like 50.
@Paul_1982 , Please check if you can use time intelligence for you measure
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
or based on today
combined
https://medium.com/chandakamit/power-bi-when-i-felt-lazy-and-i-needed-too-many-measures-ed8de20d9f79
When you drill through measure will not pass the filter. so the measure need to be there in visual to filter that visual
You can create a calculation group to filter measure during drill throiugh
User | Count |
---|---|
25 | |
11 | |
8 | |
7 | |
6 |
User | Count |
---|---|
24 | |
13 | |
12 | |
10 | |
6 |