Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
i have the following dax formula to count accumulated:
I also have a related table to "escritorio ajustado" and a related table to "Regional"
=CALCULATE(
COUNTROWS(franqueados);
franqueados[Papel na rede] = "Franquia";
FILTER(ALLEXCEPT(franqueados; franqueados[Escritório Ajustado]; franqueados[Regional]);
franqueados[Data da ativação]<= MAX('Calendar'[Date])))the problem is that when I build the pivot table with the related tables on the rows, it doesnt filter for each "escritorio"and "regional". what am I missing here?
Solved! Go to Solution.
I got it. the issue was that I wal filtering on the "franqueados" table, while I should be filtering on the "calendar" table.. Here is the measure that generates the expected running total:
=CALCULATE(
COUNTROWS(franqueados);
franqueados[Papel na rede] = "Franquia";
FILTER(
ALLSELECTED('Calendar'[Date]);
ISONORAFTER('Calendar'[Date]; MAX('Calendar'[Date]); DESC
)
)
)
Thank you very much @Anonymous and @NickDanger for participating on this thread and helping figuring it out!
Best regards,
Victor Hugo.
If you want to use the new Power BI Preview Feature of Visual Calculations, it may be very simple.
First make sure the feature is turned on in your settings:
Make a calculated column in your fact that is simply a value of "1" if the "Papel na rede" = "Franquia".
Add a "New Calculation"
Add the new column in your visual as a value
Choose the "Running Sum" calculation from the fx button and put the "Sum" of your column as the field"
Lastly, "Hide" the Sum of your measure in the fields pane
Let me know if this does the calculation as you expected!
Thanks
Nick
Hello @NickDanger , thank you for the effort!
I needed it as a measure, because I'll use it in calculations further down the road. Also, I needed it to be accumulating int time, therefore the total in 2024 should be 884.
Hi @vgarciasouza ,
Please try the following methods and check if they can solve your problem:
1.Ensure that the relationships between the tables are correctly set up.
2.Verify that the relationships are active.
3.Adjust the DAX to the following formula.
= CALCULATE(
COUNTROWS(franqueados);
franqueados[Papel na rede] = "Franquia";
FILTER(
ALLEXCEPT(franqueados; franqueados[Escritório Ajustado]; franqueados[Regional]);
franqueados[Data da ativação] <= MAX('Calendar'[Date]);
franqueados[Escritório Ajustado] IN VALUES('Table'[Escritório Ajustado]);
franqueados[Regional] IN VALUES('Table1'[Regional])
)
)
If the above ones can’t help you get it working, could you please provide more raw data(exclude sensitive data) with Text format to make a deep troubleshooting? It would be helpful to find out the solution.
You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I got it. the issue was that I wal filtering on the "franqueados" table, while I should be filtering on the "calendar" table.. Here is the measure that generates the expected running total:
=CALCULATE(
COUNTROWS(franqueados);
franqueados[Papel na rede] = "Franquia";
FILTER(
ALLSELECTED('Calendar'[Date]);
ISONORAFTER('Calendar'[Date]; MAX('Calendar'[Date]); DESC
)
)
)
Thank you very much @Anonymous and @NickDanger for participating on this thread and helping figuring it out!
Best regards,
Victor Hugo.
Hello @Anonymous , I didn't managed to make this formula work. You can find the file with a sample of the data here.
The measure I am trying to figure out is cFranqueadosAcumulados. Thank you for your help,
best Regards,
Victort Hugo.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 10 | |
| 10 | |
| 7 | |
| 5 |