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 moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
I have a measure to calculate logins on last business day. This works well provided it is in a table visual. Once I add this to a card visual, it stops working UNLESS I add a visual filter of 'Relative Date' is in this day.
Here is the measure:
Solved! Go to Solution.
Hi @AnthonyDNY ,
You can create a calendar table without weekends. And then add an index column to capture the previous working day. For example,
Table = var _tab=FILTER(CALENDAR(DATE(2022,12,1),DATE(2022,12,31)),WEEKDAY([Date],2)<>6&&WEEKDAY([Date],2)<>7)
return ADDCOLUMNS(_tab,"Index",RANKX(_tab,[Date],,ASC,Dense))
Today's Index = CALCULATE(SUM('Table'[Index]),FILTER(ALLSELECTED('Table'),[Date]=TODAY()))Previous Working Day = CALCULATE(SUM('Table'[Index]),FILTER(ALLSELECTED('Table'),[Index]=[Today's Index]-1))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AnthonyDNY ,
You can create a calendar table without weekends. And then add an index column to capture the previous working day. For example,
Table = var _tab=FILTER(CALENDAR(DATE(2022,12,1),DATE(2022,12,31)),WEEKDAY([Date],2)<>6&&WEEKDAY([Date],2)<>7)
return ADDCOLUMNS(_tab,"Index",RANKX(_tab,[Date],,ASC,Dense))
Today's Index = CALCULATE(SUM('Table'[Index]),FILTER(ALLSELECTED('Table'),[Date]=TODAY()))Previous Working Day = CALCULATE(SUM('Table'[Index]),FILTER(ALLSELECTED('Table'),[Index]=[Today's Index]-1))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AnthonyDNY ,
You can try something like this:
Hi,
I realize now I did not phrase the questioin clearly. I need the card visual to show last business day counts, not today's counts. So today being Monday, December 5th 2022, I want the card visual to show me counts for Friday, December 2nd, 2022.
Thanks
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |